Static files caching (wpredis/php7)


#1

Im facing a strange issue, in which, it seems to me that static images are being served by php instead of cache.

Google pagespeed insights reports my images as non optimized.

Nginx config is the default one of a wpredis + php7 installation, which contains caching headers, expires for static images and try_files already set for requesting images directly from cache.

I created two instanced ( one with w3tc and one with wpfc option) but they seem to behave exactly the same.

Caching headers can be seen in console, which means to me that caching system works fine, but for some reason, upon first load, static content is being asked by php, causing higher load times.

Any ideas?


#2

Hello @ggloveswp, if Google pagespeed report non optimized images, it’s not related to nginx static files cache. You have to optimize your image with a plugin like EWWW to decrease images size.


#3

Thanks for the response.

It doesnt ask me to reduse the size of images, this would be normal. It says that images are not cached. I’ve already done so via optipng, on server layer.

Let me explain:

Upon first load of http://domain.tld/image1.png, my browser downloads 62kb. Upon second load of http://domain.tld/image1.png, my browser downloads 12kb.

Google speed insights report the same image: Compressing and resizing XXXX/image1.png could save 57.8KiB (92% reduction).


#4

With easyengine wp-redis configuration, you may have to purge all cache from the redis-object-cache plugin and with the command ee cleanvia ssh.


#5

Done so via “redis-cli flushall” already.


#6