Open PixelbarEupen opened 6 years ago
So as I understand, there are two options:
We delete the whole object cache This will flush all data stored in the object cache from all plugins not only from cachify.
We store a master transient which includes an array of all cached pages. This list of cached pages is later used to delete the cached files one by one. On large websites with several hundred pages this would be a lot of data stored in the master transient. I'm not sure if this is a good idea.
If it doesn't cause any more problems, variant 1 would be fine. Since transients mostly contain some kind of cache I wouldn't have a problem with the Cachify "flush cache" button flushing the cache of other plugins as well.
https://github.com/pluginkollektiv/cachify/blob/510a51088b2ec1bf7427b6d08abb12d323c86f73/inc/cachify_db.class.php#L102
The DB cache relies on transients that are automatically cached in the object cache (if enabled) like memcache(d), redis etc...
Your delete function makes a query for all transients to delete the afterwards. But when object-cache is enabled, no transients are stored in the database, so the cache won't be cleared.
This issue is explained here: https://css-tricks.com/the-deal-with-wordpress-transients/#article-header-id-23
So, wp_cache_flush(); would be the correct function, but it will delete the whole cache... not only the cachify-transients.