inpsyde / WP-Stash

Bridge between WordPress and StashPHP, providing a PSR6-compliant caching system for WordPress
https://inpsyde.com/en/wordpress-caching-system-wpstash/
GNU General Public License v2.0
51 stars 12 forks source link

wp_schedule_event that performs pool maintenance #12

Closed Biont closed 5 years ago

Biont commented 5 years ago

As suggested by the docs:

Some drivers require that maintenance action be performed regular. The FileSystem and SQLite drivers, as an example, need to remove old data as they can't do it automatically. These operations are all abstracted away behind Pool->purge() but will need to be called regularly by the integrating applications.

The Pool->purge() function should be called as a stand alone operation. Depending on the Driver being used this can take longer than your typical action and should not be tied to a user request. It is also recommended that this be run from a command line where possible, such as in an automated cron job, in order to improve performance.

WP Stash does not currently do this, which probably bloats cache pools that do not invalidate automatically . This might add to problems when clearing the entire cache as described in #8