Cache static content = F
|
05-20-2012, 04:38 AM
Post: #1
|
|||
|
|||
Cache static content = F
Greetings everyone,
I am hoping to get some clarification on how to resolve failing at "Leverage browser caching of static assets." I am an Apache setup with my hosting company. I tried so many different setups in my htaccess file which I received from discussions here and elsewhere however I just cannot get my images to show it's caching. Some of the things I tried are (caching for 2 days)... --------------- <filesMatch "\.(png|jpg|ico|gif|jpeg)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" </filesMatch> -------------------------------------- <FilesMatch "\.(png|jpg|ico|gif|jpeg)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" Header unset Pragma Header unset Last-Modified Header unset ETag FileETag None </FilesMatch> --------------------------------------------- ExpiresActive On ExpiresDefault A0 <filesMatch "\.(png|jpg|ico|gif|jpeg)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" </filesMatch> ------------------------------------------- I just don't know what I am doing wrong or missing. I would GREATLY appreciate any assistance or feedback. Thanks! |
|||
05-21-2012, 11:21 PM
Post: #2
|
|||
|
|||
RE: Cache static content = F
Since you seem to have mod_expires, try:
Code: <IfModule mod_expires.c> I noticed you were putting a must-revalidate in the headers. WebPagetest doesn't actually check for that yet but that effectively defeats browser caching since the browser is forced to do an if-modified-since check. |
|||
05-22-2012, 08:03 AM
(This post was last modified: 05-22-2012 08:06 AM by Arris.)
Post: #3
|
|||
|
|||
RE: Cache static content = F
You are awesome! That worked.
Since I am still making changes to some of the images I didn't want to set the Cache-Control age too far until I am finished editing some of the images. I used A604800 instead of A31536000 so it will only cache for 7 days for now. I went from Cache static content = F to Cache static content = B. I believe I would get an A if I set out the cache age longer as you mentioned. Thanks again! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)