Cache regeneration – expired vs flushed
-
Hi, I have been posting a lot here as I’m trying to get the most from this incredible plugin.
I noticed that regeneration wasn’t working the way I expected. I thought that any flushed / deleted cache would regenerate, but it seems that it is coded to only regenerate caches that have expired.
Steps to produce:
1. Save a cache (/wp-json/wp/v2/posts/)
2. Modify a post to flush that cache (or manually flush it)
3. Check table (cache is flushed)
4. Run cron job to regenerate cache
5. Check table – cache is still flushed.Are flushed caches intentionally not regenerated?
The following line in theregenerate_expired_caches
method is stopping the cache regeneration from firing in class-caching.phpif ( false === get_transient( $this->transient_key( $result['cache_key'] ) ) ) {
It doesn’t check the date to see if the date has expired.
Thanks!
- The topic ‘Cache regeneration – expired vs flushed’ is closed to new replies.