Pagespeed issues rewriting - image cache just headers

143 views
Skip to first unread message

Adam Smith

unread,
Feb 15, 2022, 2:09:37 PM2/15/22
to mod-pagespeed-discuss
Hi. I've been chasing this issue for a full day.

My Apache Server is no longer returning the webp versions of images or caching any files. The original files in their original format and original names are always returned to the client.
I can see in /var/cache/mod_pagespeed/v3/mydomain.com/https,3A/,2Fmydomain.com/.. the full contents of the website, however every file (regardless of type) is 173 bytes in length and simply contains a header similar to:

        h¨^@^@^@^A<00>N(¨ê<0d>Åï/FÈÂûÄï/8^B@^BJ%
        ^DDate^R^]Mon, 14 Feb 2022 14:24:29 GMTJ(
        ^GExpires^R^]Mon, 14 Feb 2022 14:29:29 GMTJ^\
        ^MCache-Control^R^Kmax-age=300J^Z
        ^DEtag^R^RW/"PSA-12345678"Xà§^Rh^@p^@

I have tried flushing the cache, re-installing pagespeed, and even built a new server, but keep getting the same responses.

I can see in the mydomain.com/pagespeed_admin/message_history which has lots of:

        [Info] [16189] HTTPCache key=https://mydomain.com/resources/images/fav/android-icon-192x192.png fragment=mydomain.com: remembering recent failure for 299 seconds.

I've checked the logs of the proxied app and I see the request for the file with a 200 response and the agent as pagespeed.

The Apache server hosts several virtual hosts that are reverse-proxied to application servers. Some of the hosts still work with pagespeed returning the webp files, etc. I've looked at the headers of the working and non-working apps (directly - bypassing the apache server) and they are the same with regards to cache and pagespeed.

I'd appreciate it, if someone has some options I can try to help identify the issue.

pagespeed.conf

        <IfModule pagespeed_module>

                ModPagespeed on

                AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
                ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
                ModPagespeedLogDir "/var/log/pagespeed"

                ModPagespeedSslCertDirectory "/etc/ssl/certs"
                ModPagespeedFetchHttps enable
               
                ModPagespeedPreserveUrlRelativity on

                ModPagespeedFileCacheInodeLimit        500000

                ModPagespeedEnableCachePurge on

                ModPagespeedListOutstandingUrlsOnError on
                ModPagespeedStatisticsLogging on

                ModPagespeedMessageBufferSize 100000

                ModPagespeedEnableFilters extend_cache
                ModPagespeedEnableFilters rewrite_images

        </IfModule>

CHAULVET Chris

unread,
Feb 15, 2022, 2:14:18 PM2/15/22
to mod-pagesp...@googlegroups.com
Hello,

Can you try to remove all CDN, and Proxies and try again?

You should also have a header Cache value public.

What's happening if you remove that line "   AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html" ?

Regards,

Chris-Anthony CHAULVET | CEO

Office: (+33)1 77 62 44 31 Cell: (+33)6 33 30 64 12

www.nemesis-tech.com - LinkedIn - Instagram - Calendly



Garanti sans virus. www.avg.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/ed20a29e-3d0a-40ae-a60b-6a4fec6bc953n%40googlegroups.com.

Longinos

unread,
Feb 16, 2022, 4:07:15 AM2/16/22
to mod-pagespeed-discuss
Hi

This " [Info] [16189] HTTPCache key=..." say that pagespeed can´t find the cached optimized resource and remember the failure this amount of time.
Maybe a file write permisions?

Make a request with debug enabled and take a look at the html code, debug messages are set as html comments.


These "strange things" you see maybe are the metacache data. Pagespeed stores not only the optimized resource but metadata about it.

^DEtag^R^RW/"PSA-12345678"Xà§^Rh^@p^@ this header tell me that IPRO is working.
IPRO is an "on the fly" optimizer, don´t rewrite url but you can see in headers a x-original-content-length and some optimizations.
Optimized resources have an etag header like W/"0"

^MCache-Control^R^Kmax-age=300J^Z This seem to be the origin cache-control header so the optimized resource lives 300sec on the pagespeed cache aka the resource need to be optimized every 5 minutes.

Longinos

unread,
Feb 16, 2022, 4:15:28 AM2/16/22
to mod-pagespeed-discuss
Hi again

Maybe a issue with mod_rewrite?
Check diff between working serves and non working serves regarding the use of mod_rewrite in all apache config files, .htacces included.

Adam Smith

unread,
Mar 22, 2022, 11:38:10 AM3/22/22
to mod-pagespeed-discuss
Sorry guys, other work loads prevented me taking this further until now. Thanks for your responses. Unfortunately, none of them appeared to help, however I have discovered that the app developers had added a header within their application that was 'No Cache', so pagespeed was not caching anything - Even though it recorded the actions and created the 173 byte files. Once I got the developers to remove the header,  hey presto - working again.

Thanks again. Hope it helps someone in the future.

Reply all
Reply to author
Forward
0 new messages