OllieJones / sqlite-object-cache

A WordPress persistent object cache for the rest of us.
GNU General Public License v2.0
24 stars 4 forks source link

Do not automatically cache clear after 24 hours #30

Closed spacedmonkey closed 1 year ago

spacedmonkey commented 1 year ago

By default this plugin cache clears after 24 hours. This is done, I am guessing to clear out cache objects that have expired and are just hanging around. However, this will clear lots of valid caches as well.

With https://github.com/WordPress/wordpress-develop/commit/82cd43419448c343cc3df41f6e37c6185e480038 and https://github.com/WordPress/wordpress-develop/commit/19bd759db57b4f1cc72157a446915ffbafdd838e now in core, this is no longer needed.

Query caches are defined in a cache group. With a little tweak, query caches, could be setup with a say 24 hour cache expiry. Meaning, these groups would automatically invalidate themselves. Also with transient and site-transient automatically invalidating themselves, then all other caches, should remain until WordPress invalidates them.

Screenshot 2023-04-18 at 13 16 29
OllieJones commented 1 year ago

You're quite right, Jonny, I did it to keep old stale stuff from piling up., I'll repair the feature. Thanks.