Current time: 12-14-2017, 12:31 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keep failing cache test
10-10-2014, 12:39 AM
Post: #1
Keep failing cache test
I keep failing the cache test here with every site I try (although some of them are scoring 100% on pingdom tools). Here is the htaccess code I'm currently using:
Code:
Header unset FileETag
FileETag none
<IfModule mod_expires.c>
<IfModule mod_headers.c>
     ExpiresActive On
     ExpiresDefault  "access plus 1 month"
     ExpiresByType image/x-icon  "access plus 1 year"
     ExpiresByType image/gif  "access plus 1 month"
     ExpiresByType image/png  "access plus 1 month"
     ExpiresByType image/jpg  "access plus 1 month"
     ExpiresByType image/jpeg  "access plus 1 month"
     ExpiresByType text/css  "access plus 4 hour"  
     ExpiresByType application/javascript "access plus 1 year"  
     <FilesMatch  \.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$ >
          ExpiresDefault "access plus 3 month"
          Header append Cache-Control  public
     </FilesMatch>
     <FilesMatch  \.(gif|jpg|jpeg|png|swf)$ >
        ExpiresDefault a3019200
          Header append Cache-Control  public
     </FilesMatch>
     <FilesMatch  \.(xml|txt|html|js|css)$ >
          Header append Cache-Control  proxy-revalidate
     </FilesMatch>
     <FilesMatch  \.(php|cgi|pl|htm)$ >
          ExpiresActive Off
          Header set Cache-Control= no-cache
          Header set Pragma  no-cache
     </FilesMatch>
</IfModule>
</IfModule>
Find all posts by this user
Quote this message in a reply
10-10-2014, 11:58 PM
Post: #2
RE: Keep failing cache test
Do you have a test we can look at?

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
10-11-2014, 12:39 AM
Post: #3
RE: Keep failing cache test
OK here's the result from my test blog:
http://www.webpagetest.org/result/141009_QH_QZ2/
Find all posts by this user
Quote this message in a reply
10-11-2014, 04:30 AM
Post: #4
RE: Keep failing cache test
Looks like something is adding a max-age=0 which will force the browser to make a request for the resource

Cache-Control: max-age=0, proxy-revalidate

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
10-11-2014, 04:35 AM
Post: #5
RE: Keep failing cache test
It looks like your FilesMatch rules are kicking in. but the default Cache-Control header you are sending includes max-age = 0. At least for testing it might be worth setting an expires value in the match blocks for js/css and images.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-11-2014, 04:52 AM
Post: #6
RE: Keep failing cache test
Thanks I took these lines:
Code:
<FilesMatch  \.(xml|txt|html|js|css)$ >
<FilesMatch  \.(xml|txt|html)$ >
          Header append Cache-Control  proxy-revalidate
     </FilesMatch>
and changed the first one to:
Code:
<FilesMatch  \.(xml|txt|html)$ >

and that did the trick!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)