Repository navigation
Purge page caches after every write; report it in the result (0.1.18) - #12
Merged
Merged
Conversation
After each write and undo the plugin asks the active page caches to drop
the page that changed: the post (plus the home page for the static front
page) for SEO fields, alt text and the opening paragraph, the source URL
for redirects, and /llms.txt or /robots.txt as before.
Adds WP-Optimize, Nginx Helper, Breeze, Kinsta, WP Engine and Pantheon
next to WP Rocket, LiteSpeed, W3 Total Cache, WP Super Cache and
SiteGround. Every call is guarded and wrapped so a cache never breaks a
write. Each successful write result now carries
cache: { purged, failed, none }.
Fixes #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11
What changes
post_id, else the post it was uploaded to)./llms.txtor/robots.txt, as before.WPO_Page_Cache::instance()->is_enabled(), thenWPO_Page_Cache::delete_cache_by_url( $url )(false = failed)global $nginx_purger→purge_url( $url, false ), only when$nginx_helper_admin->options['enable_purge']do_action( 'purge_post_cache', $post_id )(its documented call), posts only$kinsta_cache->kinsta_cache_purge->initiate_purge( $post_id, 'post' );purge_complete_caches()for llms/robotsWpeCommon::purge_varnish_cache( $post_id );purge_varnish_cache()for llms/robotspantheon_wp_clear_edge_paths( $paths )Existing: WP Rocket (now
rocket_clean_home()for the home page, since purging its folder by URL would empty the whole cache), LiteSpeed, W3 Total Cache, WP Super Cache, SiteGround.cloudflare_purge_url_actionsfilter is read when Cloudflare loads, which is before MonoRanks (plugins load alphabetically). The opening-paragraph write saves the post, so Cloudflare's owntransition_post_statushook already purges in that case.Result field
Each successful write result has
cache: { purged: string[], failed: string[], none: bool }. All other fields are unchanged; refused changes carry nocache. Documented indocs/api.md.New filter
monoranks_purge_urlsand actionmonoranks_purged_cache;CachePurger::purge_file()keeps its old return value.Tests
Unit tests (Brain Monkey) for every adapter: active and inactive, failure, throw, home page, front page, redirect-to-post, plus a Writer test for the
cachefield. No WP-Optimize integration test (optional; it would need the plugin and its advanced-cache setup in the CI WordPress).Version 0.1.18 (header, constant, Stable tag, CHANGELOG, readme changelog). Not released.