mod_pagespeed css not updating

643 views
Skip to first unread message

Troy Glancy

unread,
Mar 14, 2012, 2:29:24 AM3/14/12
to mod-pagesp...@googlegroups.com
I have been all over the internet trying to figure out how to make this work. When mod_pagespeed is working and I make a change to css it does not update unless I turn it off or clear the cache.

Maybe I'm doing something wrong but I cannot figure out what. I have this in my pagespeed config.

ModPagespeedForceCaching on

# These caching headers are set up for the mod_pagespeed example, and
# also serve as a demonstration of good values to set for the entire
# site, if it is to be optimized by mod_pagespeed.
<Directory /var/www/mod_pagespeed_example>
  # To enable to show that mod_pagespeed to rewrites web pages, we must
  # turn off Etags for HTML files and eliminate caching altogether.
  # mod_pagespeed should rewrite HTML files each time they are served.
  # The first time mod_pagespeed sees an HTML file, it may not optimize
  # it fully.  It will optimize better after the second view.  Caching
  # defeats this behavior.
  <FilesMatch "\.(html|htm|css)$">
    Header unset Etag
    Header set Cache-control "max-age=0, no-cache"
  </FilesMatch>

  # Images, styles, and JavaScript are all cache-extended for
  # a year by rewriting URLs to include a content hash.  mod_pagespeed
  # can only do this if the resources are cacheable in the first place.
  # The origin caching policy, set here to 10 minutes, dictates how
  # frequently mod_pagespeed must re-read the content files and recompute
  # the content-hash.  As long as the content doesn't actually change,
  # the content-hash will remain the same, and the resources stored
  # in browser caches will stay relevant.
  <FilesMatch "\.(jpg|jpeg|gif|png|js)$">
    Header unset Etag
    Header set Cache-control "public, max-age=600"
  </FilesMatch>
</Directory>

This is in my httpd.conf

<IfModule mod_expires.c> 
    ExpiresActive On 
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType text/css "access plus 60 seconds"
    ExpiresByType image/gif "access plus 2 weeks"
    ExpiresByType image/jpeg "access plus 2 weeks"
    ExpiresByType image/x-icon "access plus 2 weeks" 
    ExpiresByType text/javascript "access plus 2 days"
    ExpiresByType image/ico "access plus 2 weeks"
    ExpiresByType image/png "access plus 2 weeks" 
    ExpiresByType image/jpeg "access plus 2 weeks" 
    ExpiresByType application/javascript "access plus 2 days"
</IfModule> 

What am I doing wrong? Why is my CSS not updating every 10 mins like it's suppose too?


Shawn Ligocki

unread,
Mar 14, 2012, 2:36:11 AM3/14/12
to mod-pagesp...@googlegroups.com
Can you send a link to your site?

We should update our cached version of your CSS as often as the Cache-Control: max-age. I want to check what the actual Cache-Control headers set for your CSS resources are.

Also note: ModPagespeedLoadFromFile which will update files immediately.

-Shawn

Troy Glancy

unread,
Mar 14, 2012, 2:55:04 AM3/14/12
to mod-pagesp...@googlegroups.com

Troy Glancy

unread,
Mar 14, 2012, 2:56:41 AM3/14/12
to mod-pagesp...@googlegroups.com
Not sure if  ModPagespeedLoadFromFile would work for me. I have a VPS that I host clients websites on. I don't want to have to edit their stuff manually each time. 

Troy


On Wednesday, March 14, 2012 2:36:11 AM UTC-4, Shawn Ligocki wrote:

Troy Glancy

unread,
Mar 14, 2012, 2:58:22 AM3/14/12
to mod-pagesp...@googlegroups.com
I took out the mod_expire out of httpd.conf and it seems to be changing but my score is lower because I don't have anything set for expiring headers.



On Wednesday, March 14, 2012 2:36:11 AM UTC-4, Shawn Ligocki wrote:

Troy Glancy

unread,
Mar 14, 2012, 3:01:41 AM3/14/12
to mod-pagesp...@googlegroups.com
Take that back...maybe it's not updating. 

Shawn Ligocki

unread,
Mar 14, 2012, 3:22:15 AM3/14/12
to mod-pagesp...@googlegroups.com
Hm, all of your CSS seem to have no Cache-Control headers, so they should be updated every 5 min. Which CSS file/files are you specifically not seeing updated?

-Shawn

Troy Glancy

unread,
Mar 14, 2012, 3:33:06 AM3/14/12
to mod-pagesp...@googlegroups.com
I think you're right. How can I make it 10 mins or should 5 mins be good?

Troy

Shawn Ligocki

unread,
Mar 14, 2012, 4:33:53 AM3/14/12
to mod-pagesp...@googlegroups.com
On Wed, Mar 14, 2012 at 11:59 AM, Troy Glancy <tr...@larismedia.com> wrote:
I have been all over the internet trying to figure out how to make this work. When mod_pagespeed is working and I make a change to css it does not update unless I turn it off or clear the cache.

Maybe I'm doing something wrong but I cannot figure out what. I have this in my pagespeed config.

ModPagespeedForceCaching on
Oh, don't use this option! This is for testing only.

Shawn Ligocki

unread,
Mar 14, 2012, 4:34:58 AM3/14/12
to mod-pagesp...@googlegroups.com
Can you tell me which CSS file you are not seeing updated? Or is this fixed now?

-Shawn
Reply all
Reply to author
Forward
0 new messages