mod_pagespead vs. Pagespeed Insights

76 views
Skip to first unread message

Luci

unread,
Aug 28, 2013, 1:41:21 AM8/28/13
to mod-pagesp...@googlegroups.com
I think a few people recently touched on this.

There seems to be a discrepancy between the performance of mod_pagespeed and the possible performance noted by Pagespeed Insights.

For example:

Or image compression - http://assets.aura.travel/assets/893b53ff/themes/classic/classic-map.png could save 940B (54% reduction).

Config:

    # IMAGES
    # equivalent to inline_images, recompress_images, and resize_images
    ModPagespeedEnableFilters rewrite_images

    ModPagespeedEnableFilters insert_image_dimensions,sprite_images
    ModPagespeedEnableFilters lazyload_images

    # CSS JS HTML
    ModPagespeedEnableFilters rewrite_css,combine_css,fallback_rewrite_css_urls,move_css_to_head,outline_css
    ModPagespeedEnableFilters rewrite_javascript,combine_javascript
    ModPagespeedEnableFilters remove_comments,collapse_whitespace
    ModPagespeedEnableFilters trim_urls
    ModPagespeedLowercaseHtmlNames on

Any thoughts?

Matt Atterbury

unread,
Aug 28, 2013, 9:15:16 AM8/28/13
to mod-pagespeed-discuss
HI,

I suspect you have very long cache times on some of your resources.
If I visit aura.travel I see the URL you've listed below, but if I visit aura.travel?random=your-random-string-here I get a combined and minified CSS URL like this:
Note the .pagespeed.cf.HASH.css at the end - the .cf. indicates that it was minified while the '+'s indicate it was combined.

So, could you please check you caching setup? Perhaps you're using Varnish with a long cache time?

cheers, m.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
"Klaatu barada nikto"                          (754) 444-6288

Jud Porter

unread,
Aug 28, 2013, 11:04:59 AM8/28/13
to mod-pagesp...@googlegroups.com
If indeed you are having an issue with very long cache lifetimes, setting up the ModPagespeedLoadFromFile option can be a big win. This allows mod_pagespeed to fetch resources from the file system, rather than having to make an http request. Using this option mod_pagespeed is more likely to serve rewritten resources, and can serve fresh resources right away if you update them. See https://developers.google.com/speed/pagespeed/module/domains#ModPagespeedLoadFromFile for details.

Jud Porter

unread,
Aug 28, 2013, 11:46:17 AM8/28/13
to mod-pagesp...@googlegroups.com
Oops, ignore what I said, I misunderstood the issue. It looks like your output HTML is getting cached somewhere upstream of mod_pagespeed, not the resources.

That being said, LoadFromFile is still helpful if it's an option, just not for the issue you're seeing. :)

Joshua Marantz

unread,
Aug 28, 2013, 12:57:55 PM8/28/13
to mod-pagespeed-discuss
'assets.travel' has:

Cache-Control: max-age=3600
Cache-Control: public
Server: AURA CDN 1.1

So I assume your HTML is being cached in your CDN.

I assume that to get this you used "ModPagespeedModifyCachingHeaders off".  One of the drawbacks of using that is that you can get partially optimized content cached in your CDN.  Another issue is that the content cached in your CDN may be optimized for one browser (e.g. one that supports webp images) but will be served to other browsers from the CDN.

To address the issue we have introduced the ability to purge downstream caches in 1.6: https://developers.google.com/speed/pagespeed/module/downstream-caching

This helps with the partial-optimization issue.  We also have a mechanism documented to help configure Varnish and nginx proxy caches to help incorporate a browser class into their cache keys.


On an unrelated note, I see that 'assets.travel' has mod_pagespeed-rewritten content but no X-Mod-Pagespeed header.  Did you do something specific to strip that?  That header is useful for a few reasons.  Is there a specific reason you don't want it?  The module does support changing the header value if you don't want to expose what version you are using: https://developers.google.com/speed/pagespeed/module/configuration#XHeaderValue

-Josh

Luci

unread,
Aug 28, 2013, 7:49:02 PM8/28/13
to mod-pagesp...@googlegroups.com
OK,

I have a configuration which has gone through many iterations. The expiry headers are either set by the application and passed through via ModPagespeedModifyCachingHeaders off, or added by the proxy cache later.

I am also using the downstream-caching purging to refresh more optimized content, however, sadly this is not working well, and I have been corresponding with Anupama@google trying to fix it.

The X-Mod-Pagespeed header is stripped by the proxy. Are you suggesting this affects the module functionality in some way?

Cheers,

Luci

Joshua Marantz

unread,
Aug 29, 2013, 9:21:33 AM8/29/13
to mod-pagespeed-discuss
From the doc:


Note:
 You cannot suppress the injection of this header. This is because it is used to prevent infinite loops and unnecessary rewrites when PageSpeed fetches resources from an origin that also uses PageSpeed.

-Josh


Lucian Kafka

unread,
Aug 29, 2013, 9:40:01 PM8/29/13
to mod-pagespeed-discuss
Ooopsy...

It would be so funny if this would fix all my problems :)


--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/Te1C3dcuWR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-di...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--

Lucian Kafka
AURA Travel holiday rentals
T: 02 8002 5402 | F: 02 8002 5401

Reply all
Reply to author
Forward
0 new messages