Starting today we are gradually rolling out a feature to a small subset of users to proxy some of the author hosted images via our content delivery network. We’re doing this because we’ve identified the slowest part of our page render time is spent fetching third party resources for author hosted images (such as demo images in item descriptions). Often these assets are stored on shared hosting and not utilising a content delivery network which means that while your browser is attempting to render the page, it needs to fetch these resources from a single remote origin which could be on the other side of the world.
The way we are achieving this is by rewriting the content at render time to replace all asset links with a URL that we have generated based on the checksum of the remote file. The newly written URL is proxied through our CDN and outputted to your browser ensuring it only hits our CDN for the asset (and caching it for future requests). Here is an example of what it would look like using a HTML image tag in an item description.
<img src="http://mywebsite.com/images/banner.jpg" />
<img src="https://camo.envatousercontent.com/7y65d6d7g998jt98gh4t8/bvknvkvbnnbvvhjk7" />
Here is also a visual of the request flow with the image proxying introduced.
A drawback of this approach is that authors who use some third party scripts to count impressions on the item pages will notice they are getting more concentrated hits from a single IP (our CDN nodes) instead of the client IP. The reason for this is that the tracking service does not use the
X-Forwarded-For HTTP header and instead relies on another HTTP header for the client IP.
If you update images on your image host end, remember to also update the name used so that it will result in a new image being generated on our CDN and it won’t end up with an incorrect cached version. Failing to do this will result in the old image being served until the CDN time to live (or TTL) has expired.
From a buyer perspective, they will see these pages rendered faster thanks to being able to fetch the asset from a CDN node closer to their location - hopefully leading to a higher conversion rate! Aside from the performance improvement, this is a major step forward towards our goal of running the marketplaces over HTTPS everywhere instead of being limited to pages where author hosted imagery isn’t present such as the checkout process.
If you have any questions or concerns, please don’t hesitate to get in touch (via a support ticket or forum reply) and I’m more than happy to explain anything that may have been missed or not explained clearly enough.