mod_pagespeed and w3 total cache

443 views
Skip to first unread message

sharpedezine -

unread,
Feb 19, 2015, 12:37:26 PM2/19/15
to mod-pagesp...@googlegroups.com
Hi,

I have used mod_pagespeed to great affect on non wordpress sites in the past.  I am now attempting to use it on a wordpress site that is also using the w3 total cache plugin.  My issue is that w3 total cache seems to be getting to the page before mod_pagespeed and none of the mod_pagespeed goodness is being utilized on the cached pages.

Here is an example: http://www.southerndunes.net/

Looking at the source of that page, you'll notice no mod_pagespeed


This page is not cache at all and as you can see, it is using mod_pagespeed.  The only reason this page isn't cached is because it uses an ajax availability calendar and if I cache it using w3 total cache it actually stops the ajax from firing (-1)

So, what would be the best way to get mod_pagespeed to actually work on the cached pages?  I've been searching for ages and have come up empty.

Regards

Jan-Willem Maessen

unread,
Feb 19, 2015, 1:24:47 PM2/19/15
to mod-pagesp...@googlegroups.com
Hi -

It's been a good long while since we had a discussion of w3 total cache on the list, but it was much-discussed in the early days.  Take a look at the previous discussions, then feel free to ask any questions you might still have.  Hopefully others there who are running it or have done so in the past will be able to chime in.


-Jan

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/58f27245-21ce-4902-99b3-857530eff080%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sharpedezine -

unread,
Feb 19, 2015, 1:48:05 PM2/19/15
to mod-pagesp...@googlegroups.com
Hi Jan,

Appreciate the reply.  I did actually spend an obsessive amount of time on the following discussion:

I also spent a few days trying to systematically find discussions that involved:
mod_pagespeed loads before w3 total cache
get mod_pagespeed and w3 total cache to work together
why is mod_pagespeed not working with w3 total cache

None of what I've read hints at how I can specifically get mod_pagespeed to do it's thing before w3 total cache touches the page.  At least this is what I think is happening.

I'm hopeful that they can in fact work well together and that there is a solution.  Hopefully someone on here has faced a similar issue and can provide some helpful hints.

Regards,
Khaled

Jeff Kaufman

unread,
Feb 19, 2015, 2:19:54 PM2/19/15
to mod-pagespeed-discuss
I think this is not actually a w3 cache integration issue, but that
your resources are on d2cbyrdtwaw8br.cloudfront.net and you haven't
given pagespeed permission to rewrite them. On both
http://www.southerndunes.net/ and
http://www.southerndunes.net/villa-mallory/ I see pagespeed active;
search the source for "pagespeed". You should probably let pagespeed
know that d2cbyrdtwaw8br.cloudfront.net is a pull cdn mapping back to
www.southerndunes.net so that pagespeed can optimize your cdn
resources. [1] You would do this with:

ModPagespeedDomain d2cbyrdtwaw8br.cloudfront.net

Alternatively you could make your html reference resources on
www.southerndunes.net and then ask pagespeed to rewrite them into
d2cbyrdtwaw8br.cloudfront.net.

[1] https://developers.google.com/speed/pagespeed/module/domains
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/628b93be-ef90-4f75-8a3f-c27ef2841aa5%40googlegroups.com.

sharpedezine -

unread,
Feb 19, 2015, 4:56:23 PM2/19/15
to mod-pagesp...@googlegroups.com
Hi Jeff,

Unfortunately that isn't always the case which is actually what is making me run around in circles.  Just when I think it's fixed, cache regenerates and I see a page with no pagespeed:

http://www.southerndunes.net/ (have a look at the source)

Jeff Kaufman

unread,
Feb 23, 2015, 9:24:18 AM2/23/15
to mod-pagespeed-discuss
You're right; right now when I load http://www.southerndunes.net/ I
don't see any evidence of pagespeed in the source. Is it still
enabled?

$ headers www.southerndunes.net
HTTP/1.1 200 OK
Date: Mon, 23 Feb 2015 14:20:52 GMT
Server: Apache
Last-Modified: Sun, 22 Feb 2015 21:48:36 GMT
ETag: "2fe2332-7f44-50fb43f7798be"
Accept-Ranges: bytes
Content-Length: 32580
Cache-Control: max-age=0, public, must-revalidate, proxy-revalidate,
public, must-revalidate, proxy-revalidate
Expires: Mon, 23 Feb 2015 14:20:52 GMT
Vary: Accept-Encoding,Cookie
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Pragma: public
Content-Type: text/html; charset=UTF-8

It does seem to go on if I turn it on via url:

$ headers www.southerndunes.net?PageSpeed=on
HTTP/1.1 200 OK
Date: Mon, 23 Feb 2015 14:21:49 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Pingback: http://www.southerndunes.net/xmlrpc.php
Set-Cookie: PHPSESSID=kvkd26c590njk2s7j2m19ejr01; path=/
X-Mod-Pagespeed: 1.7.30.5-3847
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Vary: User-Agent,Accept-Encoding
Cache-Control: max-age=0, no-cache
Content-Length: 32512
Content-Type: text/html; charset=UTF-8
> email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/7b2bf6a6-a681-4f58-addd-6834cda491fc%40googlegroups.com.

sharpedezine -

unread,
Feb 23, 2015, 10:12:47 AM2/23/15
to mod-pagesp...@googlegroups.com
Hi Jeff,

I have actually turned it off.  The host advised that I'm unable to map a CDN due to restrictions on their platform so that kinda threw a spanner in the works for me.

I'm in the process of looking at other hosting options that will allow me to use mod_pagespeed and I'm hopeful that I won't have a similar issue.

Thanks for looking at it for me, it is very appreciated.

Jeff Kaufman

unread,
Feb 23, 2015, 2:33:22 PM2/23/15
to mod-pagespeed-discuss
Ok; let us know if you have more questions!
>> > email to mod-pagespeed-di...@googlegroups.com.
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/51e6b346-d8e8-467e-b951-4b0b4bca6564%40googlegroups.com.

sharpedezine -

unread,
Feb 24, 2015, 8:11:39 PM2/24/15
to mod-pagesp...@googlegroups.com
Hi Jeff and anyone else who is happy to make suggestions and give advise,

Have managed to change my hosting provider and can now using domain mapping which corrects the issue I was having previously.

I was hoping someone could point me in the right direction with regards to trying to better my pagespeed scores.  I have tried various things but some files, even though referenced as pagespeed, seem to not be optimized.

Some examples:

the above shows a few files as requiring compression.  I'm assuming this is gzip compression so I'm a little confused since I have gzip enabled and all other files seem fine.



Unfortunately I am unable to do any page caching (via wordpress caching plugin) for this page as it messes with the ajax calendar. In spite of that, I think it performs quite well.

Now, I know that these scores are just a guideline but I'm hoping to understand where I can make improvements that I can take into future sites I put out.  (There's probably a LOT of room for improvement ...)

As a point of reference, I have setup like this:

Nginx > Apache > PHP-FPM

Nginx is being used as a proxy. Apache serves all static files and send php requests to php-fpm.
I am also using ngx_pagespeed (obviously) and memcache.


Regards

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/gWhFSd2vmEI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAMJ6YUt7S_6%2BAHy0J57aA3-TkkvDe2TTX7JKMPydZpzrprWsZw%40mail.gmail.com.

Jeff Kaufman

unread,
Feb 25, 2015, 1:36:01 PM2/25/15
to mod-pagespeed-discuss
When I look at Insights I'm not seeing it complain about missing gzip
compression. It says "you have compression enabled".
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAEBi0W4kn%2B%2BnEURfGxaDEQujzjLoADpZ_E22m3c%2BXXOJFZyE7A%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages