Hosting Images on an External CDN


(David Dabney) #1

I’ve been reading here in the forums about the best way to export for hosting on a CDN. So far the discussions I’ve read revolve around hosting the JS on a CDN but I can’t find info on hosting images on the same CDN.

When I export my ad using the advanced export and I use the external runtime URL the ad will load but the images won’t. I feel like I’m missing something so simple I’m gonna kick myself.

Thanks!

Export settings:

Here’s the zip file:
Default TEST.html.zip (3.1 KB)


(𝕄𝕚𝕔𝕙𝕒𝕖𝕝 𝔾𝕒𝕣𝕠𝕗𝕒𝕝𝕠) #2

The problem is that it doesn’t work that way. If you want to use an external image in a Hype project, it would be loaded in an element with regular HTML. This is not done with the exporter.

Also, I generally try to avoid CDNs. I don’t like to share visitor data with third parties. “Hot linking” can also be an issue. The source file can change unexpectedly - especially if the host doesn’t want their images added to external sites.

Instead, I like to compress my images, with software like ImageOptim or SVGOMG.


#3

If you upload the entire contents of your exported Hype folder, you would essentially be hosting your entire document on that CDN. Here’s instructions for that:

You could still fill in the external runtime URL in the Advanced Export panel, but it is not necessary. As long as your original ‘generated’ JS file is loaded from a server, all other assets will be able to use that same path.

Well, an ‘external image’ is only relative to where you are right now, eh? It’s standard practice to host ads on CDNs, so go for it. Cloudfront is the faster version of AWS that you’re using.


(𝕄𝕚𝕔𝕙𝕒𝕖𝕝 𝔾𝕒𝕣𝕠𝕗𝕒𝕝𝕠) #4

If you’re setting up your own CDN, that’s cool. I think it’s important to protect the privacy of visitors. The advertising business loves user data, eats it up like candy, but I still recommend respecting user data. Keep it private. Keep it safe.


(David Dabney) #5

Thanks for the quick response and advice but I’m still confused. TripAdvisor wants all the assets hosted on a CDN while we send them just the html doc for placement. We don’t have access to Double Click for Publishers.

Is it possible to alter the exported files or have an export setting that allows us to send the index.html file to TA and have any external files be referenced by the full CDN url?


#6

You would export normally, which generates an HTML file containing a reference to a JS file.

  1. Upload your .hyperesources folder, which contains that generated .js file, to your CDN
  2. In your exported .html file, modify the ‘src’ area which references the generated JS file and point it to the full URL of your generated JS file.

This will effectively load everything from your CDN, and lets you deliver a single .html file to TA.