Many WordPress websites contain pages or posts that are rarely updated. The server load can be reduced for these pages through page cache plugins such as WP Cache or W3 Total Cache. However such solutions still need to purge/regenerate pages for every specified interval (5/10/15/30 minutes for example).

How can we set rarely/never updated pages to be cached only once, until they are affected by an edit ? Is there a way to make caching less temporary for these pages without affecting the refresh rate of the whole website ?

  • 2
    This will be specific to whatever cache plugin you’re using, you’ll need to inquire via their support channels. – Milo Feb 2 '18 at 1:03

In reality it is very hard to know when a page is affected by an edit. A page contains footer, memus, widgets, shorcodes and meta data which might change "globaly". Having a general detection which page is affected by any such change is bordering the impossible.

Cache expiration in general is just a very hard thing to do optimally, and setting an interval until it should happen is just a si,ple compromise between the need to have cache and the inability to have a good expiration policy.

In the real world, it does not even matter much for how long you are caching your pages and even a duration as low as 5 minutes can be good enough, as for most sites most pages are just not being accessed more than once in a while.

The real caching strategy for which it is easier to detect information expiry and which actually reduces load on your server is object caching. Getting this to work right is much more important than page caching.

| improve this answer | |

You could use the plugin: WP Super Cache

Once installed and activated if you go to:

Settings --> WP Super Cache --> Advanced --> Advanced

and make sure the:

Clear all cache files when a post or page is published or updated.

Is ticked you can also do the same for comments.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.