Re: Some filters not working in production environment

67 views
Skip to first unread message

Joshua Marantz

unread,
Oct 17, 2012, 9:26:08 AM10/17/12
to mod-pagespeed-discuss
Please check the faq entry: https://developers.google.com/speed/docs/mod_pagespeed/faq#not-rewriting

In particular, check these:
  • Your resources (images, css, javascript) aren't cacheable. If mod_pagespeed sees cache-control headers such as nocache or private it will not rewrite the resources.
  • CSS, JavaScript, and image files served from a distinct domain from the HTML must have the resource domain authorized. See Domains.


On Wed, Oct 17, 2012 at 4:25 AM, Reinier Kip <ma...@reinierkip.nl> wrote:
Hello all,

Some filters I have enabled in my development environment, don't work in my production environment. Examples are the combine_* and image filters. Whitespace collapsing and comment and quote removal work OK. The servers are fairly similar, production has Plesk installed. What can be the cause of this? Is there a log I can view that explains pagespeed's "decisions"?

Filters I have enabled in my dev env: extend_cache,collapse_whitespace,combine_css,combine_javascript,sprite_images,rewrite_css,rewrite_javascript,inline_images,recompress_images,convert_jpeg_to_webp,remove_comments,remove_quotes,convert_meta_tags,move_css_to_head

Pagespeed version on both environments: X-Mod-Pagespeed:1.0.22.7-2005
Same pagespeed.conf that is shipped with the module, except with ModPagespeed off.
Same VirtualHost configuration:

<IfModule pagespeed_module>
Include "/etc/apache2/mods-enabled/pagespeed.conf"
ModPagespeed on
ModPagespeedEnableFilters extend_cache,collapse_whitespace,combine_css,combine_javascript,sprite_images,rewrite_css,rewrite_javascript,inline_images,recompress_images,convert_jpeg_to_webp,remove_comments,remove_quotes,convert_meta_tags,move_css_to_head
</IfModule>

Thanks for your time,

Reinier Kip

Joshua Marantz

unread,
Oct 19, 2012, 8:34:51 AM10/19/12
to mod-pagespeed-discuss
Please look at the faq (https://developers.google.com/speed/docs/mod_pagespeed/faq#not-rewriting).

Did you check the server logs to see whether the Serf fetches for those resources are working?  Are the CSS files in the same exact domain as the HTML?  Turning on "loglevel info" will usually help track down these issues as well.

-Josh


On Wed, Oct 17, 2012 at 10:52 AM, Reinier Kip <ma...@reinierkip.nl> wrote:
Thank you for your time, jmarantz.

I've fetched the website's homepage and its global.css. The response headers are as follows.

Page HTML:

curl -D- http://example.com | less

Date: Wed, 17 Oct 2012 14:42:12 GMT
Server: Apache
Set-Cookie: ***
Set-Cookie: ***
Set-Cookie: ***
Cache-Control: max-age=0, no-cache
Pragma: no-cache
Set-Cookie: ***
X-Mod-Pagespeed: 1.0.22.7-2005
Vary: Accept-Encoding
Content-Length: 23279
Content-Type: text/html

...
<link href="/css/global.css" rel=stylesheet>
...

Fetching a CSS file (same CSS as on our development server, containing the same CSS(3) constructions):


Date: Wed, 17 Oct 2012 14:44:23 GMT
Server: Apache
Last-Modified: Thu, 04 Oct 2012 11:54:40 GMT
ETag: "39474e-2a31e-4cb3a6b904000"
Accept-Ranges: bytes
Content-Length: 172830
Vary: Accept-Encoding
X-Powered-By: PleskLin
Content-Type: text/css

Joshua Marantz

unread,
Oct 19, 2012, 9:43:21 AM10/19/12
to mod-pagespeed-discuss
I was referring to the Apache error log.  Depending on your OS it might be in someplace like /var/logs/apache2/error.log.


-Josh


On Fri, Oct 19, 2012 at 9:39 AM, Reinier Kip <ma...@reinierkip.nl> wrote:
Thanks again for your time.

I am very sorry, but I have no clue as to what Serf fetches are and in what logs they should appear.

The example css file, global.css is referenced as shown in the HTML a couple of posts back: without a domain:

<link href="/css/global.css" rel=stylesheet>

An excerpt from the access log:

x.x.x.x - - [19/Oct/2012:15:28:37 +0200] "GET /xx/xx HTTP/1.1" 200 6254 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"
x.x.x.x - - [19/Oct/2012:15:36:45 +0200] "GET /css/global.css HTTP/1.1" 200 24441 "http://xx.xx/xx/xx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"

Any use?

Reinier

Joshua Marantz

unread,
Oct 19, 2012, 10:00:18 AM10/19/12
to mod-pagespeed-discuss
OK you probably want to look at ModPagespeedMapOriginDomain &/or ModPagespeedLoadFromFile.

-Josh



On Fri, Oct 19, 2012 at 9:50 AM, Reinier Kip <ma...@reinierkip.nl> wrote:
Thank you, I think this will solve my issue. My error log didn't show any such name resolution errors. However, while the domain does resolve to the server, it seems to resolve to a fallback virtual host, giving a 404 on resources like the CSS file.

Thanks a lot for your effort!
Reply all
Reply to author
Forward
0 new messages