MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Despite caching code, Cache Static Content gets F
Current time: 11-27-2020, 04:41 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Despite caching code, Cache Static Content gets F
07-19-2013, 04:49 AM (This post was last modified: 07-19-2013 06:00 PM by CrisBCT.)
Post: #1
Despite caching code, Cache Static Content gets F
Hi,

I'm a newbie here with rather limited knowledge of technical matters. I've read every post on this forum on Cache Static Content. My URL is: http://www.LifeStrategies.net created with RapidWeaver on a Snow Leopard Mac. My test results are at http://www.webpagetest.org/result/130718...bebd19823/

I'm getting AAAAF now, having compressed my header image, and Cache Static Content still rates F. see http://www.webpagetest.org/result/130718...e238d222c/

Over a year ago, I copied someone's code and set my htaccess file to cache images etc using:

# Set up caching on media files for 6 months. 2012/05/01
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
ExpiresDefault A14515200
Header append Cache-Control "public"
</FilesMatch>
# end caching code

So isn't caching already enabled? Yet Cache Static Content says even my favicon .ico is not cached, which should be cached by this. Is webpagetest.org ignoring the 6 months ExpiresDefault I've specified? Or have I made a mistake copying this somehow? Am I getting any caching or not?

It did seem to make a difference when I put this snippet in htaccess, my pages load within a couple of seconds. Should I instead specify each type separately, perhaps go to the one year maximum, by using:

ExpiresByType image/ico A31536000
ExpiresByType image/jpg A31536000
ExpiresByType image/png A31536000

And should I add css and javascript to it, eg:

ExpiresByType text/css A31536000
ExpiresByType text/javascript A31536000

I'm wondering if this could be the cause of the problem? Google's help page at: https://developers.google.com/speed/docs...serCaching specifies:

"Expires and Cache-Control: max-age. These specify the “freshness lifetime” of a resource, that is, the time period during which the browser can use the cached resource without checking to see if a new version is available from the web server. They are "strong caching headers" that apply unconditionally; that is, once they're set and the resource is downloaded, the browser will not issue any GET requests for the resource until the expiry date or maximum age is reached.

"...Last-Modified is a "weak" caching header ... It is important to specify one of Expires or Cache-Control max-age, AND one of Last-Modified or ETag, for all cacheable resources."


So Developers.Google says I should BOTH use Expires AND to specify a date as Last Modified. But why need both? Should I specify both?

If so, where and how do I specify Last-Modified or use the "CacheIgnoreNoLastMod On" directive. Can either of these be done in htaccess, if so exactly how and where?

Thanks a million for all and any help...
Cris
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Despite caching code, Cache Static Content gets F - CrisBCT - 07-19-2013 04:49 AM

Forum Jump:


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