Mobile app version of vmapp.org
Login or Join
Miguel251

: Files not caching We store our images on S3 and our performance has been incredibly slow. This morning we turned on CloudFront in hopes that our performance would increase. When I analyze

@Miguel251

Posted in: #Cache #WebDevelopment

We store our images on S3 and our performance has been incredibly slow. This morning we turned on CloudFront in hopes that our performance would increase. When I analyze our performance with Google's Dev Tools or YSlow, our site is still slow. Both tools recommend I set expire times so browsers cache the images. I looked in our .htaccess file, mod_expires is turned on with the following rules:

<IfModule mod_expires.c>
Media: images, video, audio

ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
</IfModule>


Why are our images not being cached by the browser?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

You'll need to add the cache control headers using the S3 console as your Apache .htaccess only affects locally stored files.

Within the S3 console, go to the Properties -> Metadata section for each file you want to change
Add Cache-Control, Expires & Last-Modified headers with appropriate values

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme