Cache stops working after some time

31 views
Skip to first unread message

Леонид Бугаенко

unread,
Aug 7, 2017, 2:14:40 AM8/7/17
to mod-pagespeed-discuss
Hello, I set up modpagespped on my site https://kavkazsuvenir.ru/. Consider the main page. Images previews are converted and compressed as needed. But, if you go to the page in an hour - then we again see uncompressed images. We update the page - and now the part is compressed, we update again - almost all the images are compressed, the third time we see that all the images are compressed.
Tell me why this happens?
        pagespeed on;

        pagespeed FileCachePath "/var/cache/mod_pagespeed/";
        pagespeed FileCacheSizeKb            8024000;
pagespeed FileCacheCleanIntervalMs   -1;
pagespeed FileCacheInodeLimit        500000;
pagespeed LRUCacheKbPerProcess     16384;
pagespeed LRUCacheByteLimit        131072;

                 pagespeed EnableFilters recompress_jpeg;

        pagespeed EnableFilters convert_jpeg_to_progressive;
        pagespeed EnableFilters convert_jpeg_to_webp;
        pagespeed EnableFilters convert_to_webp_lossless;
        pagespeed EnableFilters jpeg_subsampling;
        pagespeed JpegRecompressionQuality 85;
        pagespeed ImageRecompressionQuality 85;
        pagespeed WebpRecompressionQuality 85;
        pagespeed JpegRecompressionQualityForSmallScreens 85;
        pagespeed WebpRecompressionQualityForSmallScreens 85;
                 pagespeed LazyloadImagesAfterOnload on;
        pagespeed ImageJpegNumProgressiveScans 5;
        pagespeed EnableFilters recompress_images;
        pagespeed EnableFilters resize_images;
        pagespeed ImageInlineMaxBytes 2048;
        pagespeed LowercaseHtmlNames on;
        pagespeed DownstreamCacheRewrittenPercentageThreshold 90;
        pagespeed EnableFilters extend_cache;
        pagespeed EnableFilters collapse_whitespace;
        pagespeed EnableFilters hint_preload_subresources;
        pagespeed EnableFilters insert_dns_prefetch;
        pagespeed EnableFilters remove_comments;
        pagespeed EnableFilters rewrite_style_attributes;
        pagespeed EnableFilters rewrite_css;
        pagespeed EnableFilters prioritize_critical_css;
        pagespeed EnableFilters rewrite_javascript;
        pagespeed EnableFilters combine_javascript;


Luke Kenneth Casson Leighton

unread,
Aug 7, 2017, 2:56:01 AM8/7/17
to mod-pagesp...@googlegroups.com
On Mon, Aug 7, 2017 at 7:14 AM, Леонид Бугаенко
<bugaenk...@gmail.com> wrote:

> Hello, I set up modpagespped on my site https://kavkazsuvenir.ru/. Consider
> the main page. Images previews are converted and compressed as needed. But,
> if you go to the page in an hour - then we again see uncompressed images. We
> update the page - and now the part is compressed, we update again - almost
> all the images are compressed, the third time we see that all the images are
> compressed.

funny, i am noticing the same thing. i have
ModPagespeedRewriteRandomDropPercentage 90 set but the number of times
that the images change from compressed to uncompressed is far far
lower than that.

certainly i am aware that there are multiple threads/processes on
apache2... your config format indicates you are using nginx... let's
confirm that....

telnet kavkazsuvenir.ru 80
Trying 82.146.35.82...
Connected to kavkazsuvenir.ru.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 301 Moved Permanently
Server: nginx/1.12.1
Date: Mon, 07 Aug 2017 06:51:27 GMT
Content-Type: text/html
Connection: close
Location: https://kavkazsuvenir.ru:443/

Connection closed by foreign host.

yes so you're using nginx. so, whereas i am using apache2 mpm_worker
and was previously using mpm_prefork and there *still* were images
being arbitrarily dropped from compression, nginx... never used it...
let's google it... ok so it has one "master" process and multiple
"worker" processes so it's the same sort of model as apache2.

so.

what *might* be happening is that some of the nginx processes have a
different in-memory view of what they should serve. certainly i've
seen this happen before: HTTP is stateless so when you do a page
refresh (even immediately) you get a DIFFERENT process serving the
exact same request.

if each process has cached different content then you'll get....
different content.

so what needs to be established is: why is different content being
served by different worker processes?

l.

Otto van der Schaaf

unread,
Aug 7, 2017, 11:04:14 AM8/7/17
to mod-pagesp...@googlegroups.com
mod_pagespeed respects the http cache expiry times that go with the responses for the original images. After an image expires, mod_pagespeed will revalidate. During that time you may see partially or unoptimized results (mod_pagespeed works with a configurable deadline: https://modpagespeed.com/doc/system#rewrite_deadline).

So to get a more steady optimization state, you could consider sending the original images over http with larger expiry times.
Or, you could configure mod_pagespeed to load static resources directly from disk: https://modpagespeed.com/doc/domains#ModPagespeedLoadFromFile

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/2798859c-244e-4229-bf2c-9b3f06109ed5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Kenneth Casson Leighton

unread,
Aug 7, 2017, 2:39:38 PM8/7/17
to mod-pagesp...@googlegroups.com
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68


On Mon, Aug 7, 2017 at 4:04 PM, Otto van der Schaaf <osc...@we-amp.com> wrote:
> mod_pagespeed respects the http cache expiry times that go with the
> responses for the original images. After an image expires, mod_pagespeed
> will revalidate. During that time you may see partially or unoptimized
> results (mod_pagespeed works with a configurable deadline:
> https://modpagespeed.com/doc/system#rewrite_deadline).
>
> So to get a more steady optimization state, you could consider sending the
> original images over http with larger expiry times.
> Or, you could configure mod_pagespeed to load static resources directly from
> disk: https://modpagespeed.com/doc/domains#ModPagespeedLoadFromFile

yyeahh i don't know about the OP, i've done both of those - set
something like a month. found a very good site with a
highly-recommended expiry config (for apache2). also just a couple
days ago set up LoadFromFile for /images/ and /new_css... yet just
like the OP i see optimisations intermittently, then they disappear
entirely. it's very weird.

l.
Reply all
Reply to author
Forward
0 new messages