Closed ouun closed 2 years ago
Please let me know if you are open for a PR into this direction.
Hi @ouun and thanks for your issue!
I haven't looked myself at the code, but your explanation and solution looks fine for me. Would be great if you submit a PR for further discussions.
Hi @Zodiac1978,
thanks for your answer. I just went ahead and dived a bit deeper into Cachify. Got a bit confused as I realized that the wp_trash_post
hook will clear the complete cache, too.
Nevertheless there is a method delete_item()
for individual post cache flushing available for each Caching Method (DB, HDD,...) and cachify_remove_post_cache
as a hook, that is never executed.
However I started with a PR here and therefore close this one: https://github.com/pluginkollektiv/cachify/pull/247
Let's keep this issue open until the PR is merged. For better tracking I have linked the issue and the PR.
Describe the bug Thanks for the ongoing work on this simple and great plugin. I just realized that the automatic processing function
wp_delete_post_revision()
callswp_delete_post()
to delete the revisions. This flushes the complete Cachify cache asdo_action('before_delete_post')
is triggered.This flushes the complete page cache unnecessarily as post revisions won't get cached at all. Deleting them has no impact on the frontend.
To Reproduce Steps to reproduce the behavior:
define('WP_POST_REVISIONS', 1)
wp_delete_post_revision()
is executedExpected behavior Cache flushes only for posts with status "publish". The hook
before_delete_post
can pass$post_id
and$post
to theflush_total_cache()
function. A check for the post status could help, here. Please let me know if you are open for a PR into this direction.System (please complete the following information):