Reputation: 71
I have written this in my .htaccess file to leverage browser caching:
# 480 weeks caching
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
It is working well for files coming from mydomain.com url but the problem is that it does not affect the images coming from CDN URLs which are actually subdomains static.mydomain.com etc.
How can I leverage browser caching for images served through CDN?
Upvotes: 1
Views: 1125
Reputation:
Are you using S3? You can add this header in the S3 console for resources you want to cache:
CacheControl: max-age=999999
Upvotes: 3