No image compression with mod_pagespeed

1,138 views
Skip to first unread message

Grzegorz Kiersznowski

unread,
Feb 10, 2016, 7:41:04 PM2/10/16
to mod-pagespeed-discuss
Hello,
We have a weard problem with mod_pagespeed.
It's enabled and does rewrite images, but does not recompress them.
Please look at this: https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fantyweb.pl%2F&tab=desktop
At the list with images which should be optimised are few files which was rewriten (changed file name - "*.pagespeed" added) but their size are big and PageSpeed Insights suggest that they could be 70-90% smaller.

At htaccess we have only:
<IfModule pagespeed_module>
    ModPagespeed on
</IfModule>

What's the reason?

Otto van der Schaaf

unread,
Feb 11, 2016, 8:57:57 AM2/11/16
to mod-pagespeed-discuss
The images that do not get optimized keep getting served with"Cache-Control: max-age=300,private",which is weird.
Are there any warnings or errors from mod_pagespeed in the logs that mention those files?

Otto

Joshua Marantz

unread,
Feb 11, 2016, 9:33:28 AM2/11/16
to mod-pagespeed-discuss

I noticed the private/300 responses as well.  Is this a multi server setup?  Can you describe your serving stack a bit more?

And also I am interested to see if there are any pagespeed log messages in your error.log.

Josh

--
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/a2f75d63-0275-43a2-b277-e263bfa03f61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Kaufman

unread,
Feb 11, 2016, 9:35:03 AM2/11/16
to mod-pagespeed-discuss
One of the images pagespeed insights finds is
http://antyweb.pl/wp-content/themes/antyweb.autentika/i/content/xlogo-cmp-2.png.pagespeed.ic.Scf94Kw8y7.png

This is being served with Cache Control 300, which PageSpeed does when
something goes wrong. Serving an unoptimized version is also what
PageSpeed would do if something went wrong.

Some things that could cause this:
* Requests for http://antyweb.pl/wp-content/themes/antyweb.autentika/i/content/xlogo-cmp-2.png.pagespeed.ic.Scf94Kw8y7.png
being handled by a different server than http://antyweb.pl without a
shared cache
* A cache that's too small for all the resources, so some things are
getting evicted.
> --
> 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/cc55034c-1610-41f3-803e-6633c8a4e638%40googlegroups.com.

Grzegorz Kiersznowski

unread,
Feb 12, 2016, 12:12:34 PM2/12/16
to mod-pagespeed-discuss
Some answers to you questions and some additional information:

1. Nope - that's not multiple server setup... We have one server with Apache+PHP+Mod_pagespeed
2. We have a lot disk space for pagespeed have - it used 3.2GB from 17GB available
3. At ModPagespeedLogDir we have only stats_log_global file, there's no error log...
4. That is a Wordpress with W3 Total Cache plugin
5. Cache files are saved on tmpfs RAMDisk

In pagespeed.conf we have:
ModPagespeedInheritVHostConfig on
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedFileCacheInodeLimit        500000

Content of htaccess includes:
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A31536000
    ExpiresByType text/x-component A31536000
    ExpiresByType application/x-javascript A31536000
    ExpiresByType application/javascript A31536000
    ExpiresByType text/javascript A31536000
    ExpiresByType text/x-js A31536000
    ExpiresByType video/asf A31536000
    ExpiresByType video/avi A31536000
    ExpiresByType image/bmp A31536000
    ExpiresByType application/java A31536000
    ExpiresByType video/divx A31536000
    ExpiresByType application/msword A31536000
    ExpiresByType application/vnd.ms-fontobject A31536000
    ExpiresByType application/x-msdownload A31536000
    ExpiresByType image/gif A31536000
    ExpiresByType application/x-gzip A31536000
    ExpiresByType image/x-icon A31536000
    ExpiresByType image/jpeg A31536000
    ExpiresByType application/json A31536000
    ExpiresByType application/vnd.ms-access A31536000
    ExpiresByType audio/midi A31536000
    ExpiresByType video/quicktime A31536000
    ExpiresByType audio/mpeg A31536000
    ExpiresByType video/mp4 A31536000
    ExpiresByType video/mpeg A31536000
    ExpiresByType application/vnd.ms-project A31536000
    ExpiresByType application/x-font-otf A31536000
    ExpiresByType application/vnd.ms-opentype A31536000
    ExpiresByType application/vnd.oasis.opendocument.database A31536000
    ExpiresByType application/vnd.oasis.opendocument.chart A31536000
    ExpiresByType application/vnd.oasis.opendocument.formula A31536000
    ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
    ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
    ExpiresByType application/vnd.oasis.opendocument.text A31536000
    ExpiresByType audio/ogg A31536000
    ExpiresByType application/pdf A31536000
    ExpiresByType image/png A31536000
    ExpiresByType application/vnd.ms-powerpoint A31536000
    ExpiresByType audio/x-realaudio A31536000
    ExpiresByType image/svg+xml A31536000
    ExpiresByType application/x-shockwave-flash A31536000
    ExpiresByType application/x-tar A31536000
    ExpiresByType image/tiff A31536000
    ExpiresByType application/x-font-ttf A31536000
    ExpiresByType application/vnd.ms-opentype A31536000
    ExpiresByType audio/wav A31536000
    ExpiresByType audio/wma A31536000
    ExpiresByType application/vnd.ms-write A31536000
    ExpiresByType application/font-woff A31536000
    ExpiresByType application/vnd.ms-excel A31536000
    ExpiresByType application/zip A31536000
</IfModule>
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
    </IfModule>
</IfModule>
<FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
    FileETag MTime Size
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public"
    </IfModule>
</FilesMatch>

Grzegorz Kiersznowski

unread,
Feb 12, 2016, 2:25:27 PM2/12/16
to mod-pagespeed-discuss

Otto van der Schaaf

unread,
Feb 15, 2016, 10:07:43 AM2/15/16
to mod-pagespeed-discuss
Do you have the admin pages enabled? 
- The message history in there would be good to check, to see if there's any errors or warning from mod_pagespeed (/pagespeed_admin/message_history).
- It may also help if you could post two snapshots here of the statistics page, allowing a few minutes to pass beween the first and second snapshot to allow some traffic
to pass (/pagespeed_admin/statistics).

Otto

Grzegorz Kiersznowski

unread,
Feb 17, 2016, 9:40:29 AM2/17/16
to mod-pagespeed-discuss

Grzegorz Kiersznowski

unread,
Feb 17, 2016, 2:39:03 PM2/17/16
to mod-pagespeed-discuss
Ok, so now I see that there's a lot of warnings like: http://i.imgur.com/5oCH1J3.png



W dniu poniedziałek, 15 lutego 2016 16:07:43 UTC+1 użytkownik Otto van der Schaaf napisał:

Otto van der Schaaf

unread,
Feb 17, 2016, 2:48:13 PM2/17/16
to mod-pagespeed-discuss
From the logs it looks like mod_pagespeed was shedding a lot of load.  That may be because of the cap you put on the maximum number of parallel image rewrites (I derived that from adding ?PageSpeedFilters=+debug on the querystring for a html request, could you post all pagespeed configuration?).
It may just have been that it took a while for pagespeed to complete all optimization because of the throttling here. Some of the images mentioned earlier in this thread now seem to be served as fully optimized.

As there are also fetch failures in the logs, it may be worth giving LoadFromFile a shot (where they concern static files):

As for digging up the underlying reason for the logged fetch failurues: 
perhaps Apache's access logs provide a clue (pagespeed mentioned modpagespeed in its useragent when performing fetches).

Otto


--
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/eb444184-07db-499f-8c9f-ec8302f93590%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages