Pagespeed and WordPress

wordpress

#1

I’m trying to understand Pagespeed better, and want to ask if it’s working properly for our domain?

We have a WordPress multisite. The images on the pages load with normal URLs the first time, i.e.:

Then in subsequent re-loads of the page, the URLs change to:

This new code functions, but it’s not pretty. And one of the major problems I’m noticing is that when I swap out the image for one with the same name, the cached version is still the one that appears.

So my question is: is this how pagespeed is supposed to function, or is something funky with my WP theme? Do I have any control over the caching, and can I refresh the cache when I need to make a change to the images that are loaded?


#2

Yes, this is what mod_pagespeed does. It’s cached the output of the Timthumb script, and the weird-looking URL you’ve got there is its way of referring to the result.

I’d recommend that you disable mod_pagespeed while you’re still working on your site. We don’t currently have any way to allow customers to purge its cache, so it’ll make things easier if you just turn it on once you’re done.


#3

Good to know. What I’m building however is a multisite setup, with the intention that mini WordPress sites will be created at different times. Perhaps not often, but basically the site will always be in development.

Is this a case where I would want to turn off mod_pagespeed? Or is it worth it enough that I should turn it off and then back on after the development of each new mini-site?


#4

Multisite and Timthumb aren’t besties, just FYI.

You can tell pagespeed to ignore timethumb, though… That might do the trick for you.

<IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedDisallow /wp-content/themes/customtheme/inc/xtimthumb.php*
</IfModule>

In general, though, I turn off pagespeed while developing and turn it back on when I’m done. It only really matters when I change my CSS.


#5

Hi @Ipstenu-DH - sorry to revive a 2-month old thread, but is there a way to flush the mod_pagespeed cache or force it to reset yet?

If I make the slightest CSS change to my client’s WP blog, even if I disable mod_pagespeed via the panel or via .htaccess, turning it back on results in the original unmodified CSS. I even tried changing some of the config switches in the .htaccess hoping it would reload the CSS to apply the new options, but it still shows the original cached copy from a couple of hours ago.

Barring there being no way to flush the cache, is there a way to set a duration for it? Or what is the default mod_pagespeed cache duration (particularly on CSS files)?

Seems like a great feature, but with no way to flush it, it’s really tough to use unless you’re making absolutely no changes to any of your site resources.

Thanks,
-nick


#6

The only way for you to flush pagespeed is to turn it off via Panel and then turn it back on. Which is stupid, I know, but has to do with how PageSpeed later came up with the way caching is saved and served. We have a couple ideas on how to make it easier, but it involves re-jiggering some things, and initial tests did not work the way we wanted :confused:


#7

For what it’s worth, I’d highly recommend leaving Page Speed off while you’re still working on your site. Not only does it cache some content, but it also rewrites content in ways that’ll make it more difficult to debug. Hold off on turning it on until you’re finished with development.


#8

Very true. The catch happens when, like me, you realize “Oh I just wanna change that CSS color…”