Leverage browser caching of static assets

Hi,

I have a general question about Leverage browser caching of static assets

although I add an plugin to change the the life cycle, please see screenshot below

https://www.screencast.com/t/AXDhd7Th

but still getting those consitent result from all pagespeed test

https://www.screencast.com/t/Z9DHMUAzC

I want to know which is "most effect way" to fix this kind of issue, there are tons of solution online but I prefer asking virtualmin :)

P.S there are tons of pictures in this site, so I will also use keycdn to speed up the loading speed after fixing this issue

franchise.slabburgers.com

Thanks

Status: 
Active

Comments

Diabolico's picture
Submitted by Diabolico on Thu, 02/23/2017 - 04:47

This question you should ask the Author of that plugin or post your question on WP forum. Other solution would be to drop any caching plugin and instead use Opcache (PHP module) with or without APCu (not APC).

For max-age best and easiest solution is to modify your .htaccess file and there are a lot of "how-to" on Google.

When it comes to Wordpress you will never get good results if you dont tweak WP itself. But there are other things like theme and plugins what will affect how your WP works.

Howdy -- thanks for contacting us!

Yeah it does sound like you may want to start with what Diabolico mentioned above, which is to look into setting the max-age via your domain's .htaccess file.

For specifics on how to do that, you may just want to Googe "max-age htaccess", the first couple of StackOverflow links may do exactly what you're after.

I haven't tested those, but that does seem to work for other folks!

I actually follow a some samples in google, seems not working yet....questio

do I need to reboot that particular virtual server?

No, changes to the htaccess file should be immediate.

Though you may consider restarting Apache just to ensure something isn't being cached.

unborn's picture
Submitted by unborn on Thu, 03/02/2017 - 06:38 Pro Licensee

Hi guys, well, first of all if you use apache you can achieve this for any website - static or dynamic..and of course you will get great results even with wp. I am a bit surprised that I see this ticket here pointing client out to some solutions on google or stackoverflow for premium support user marked with small start..

Anyway here is what you need to do info@orderlastm... :

  • enable mod_deflate
  • enable mod_headers
  • enable mod_expires
  • you can edit some apache configs to make specific files to be cached or leave it as default
  • restart apache

Next step would be editing your htaccess to enable compression and cache and other things for the things you really want to cache. I could help you with this but that it outside of free support scope I offer to anyone. I use it on my site and it does makes dramatic changes when everything setup correctly.

thanks unborn

I did some of them since I don't have a "to do list", this helps a lot.

unborn's picture
Submitted by unborn on Thu, 03/02/2017 - 14:34 Pro Licensee

@ info@orderlastm..

you welcome! sometimes it would be worth to ask on forums and here as well.. creating htaccess for what you asked is quiet easy in fact - you will end up in ggl page score around 98/100 once you do it correctly without any plugins. if you will still struggle with it just give me shout here or on forums (notice that contact form does not working here for about 4 years...but just reply here and I will follow). - have fun.

Edit: no plugins need it for this issue at all