docker-nginx-pagespeed icon indicating copy to clipboard operation
docker-nginx-pagespeed copied to clipboard

Page cache in redis removing pagespeed features

Open dempa266 opened this issue 5 years ago • 2 comments

Hello!

When using redis to cache pages using srcache the cached html wont include the pagespeed features.

For instance on first page load when the page isnt cached I see that the images are converted to .webp but when i refresh the page and hit the cache they are not. Also javascript/css isnt combined.

It seems to work with disk cache "fastcgi".

Any idéa why?

dempa266 avatar Apr 27 '20 08:04 dempa266

The experiences I've had with PageSpeed and cache is that PageSpeed may take several requests to finally combine and convert all images. The cache will store and serve the first qualified request. So sometimes you need to flush cache or wait for it to expire to see a fully optimized PageSpeed parsed page.

I use a separate cache engine for page cache (Redis) and for the page speed (Memcached) to avoid the situation when I flush Redis cache to make PageSpeed re-optimize page again.

Another issue I've head with the PageSpeed was related to gzip content (but I think they have already addressed this in the latest releases). In order to PageSpeed to kick in, I had to disable gzip (but I am not sure if I am not confusing this with substitution module - it was a while back).

You can manipulate TTL for Redis cache there in the config. Hope that helps.

markhilton avatar Apr 27 '20 19:04 markhilton

Alright thanks a bunch!

dempa266 avatar Apr 28 '20 08:04 dempa266