Is there a way to automatically change the image links that is served on templates to their CDN versions?
Tried using the htaccess 301 redirect method but it is causing a substantial increase in page rendering time due to numerous image redirects in an image heavy site (around 20-40 images per page).
I use a multi-environment config and set a variable of {global:cdn_url}. In the config, I check the environment to see if it’s production. If it’s production, I set {global:cdn_url} to the cdn URL. If it’s not, I just set it to a forward slash. Then, for all my images, I use {global:cdn_url}/url/to/img.jpg or whatever. Often it looks like {global:cdn_url}{img:url}. Obviously this means having your CDN set up as a pull zone so that it pulls the image from your local server the first time then serves it from the CDN thereafter.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.