Skip to content

Reimplement Varnish cache purging#786

Open
jaymcp wants to merge 2 commits into
stagingfrom
fix/varnish-caching
Open

Reimplement Varnish cache purging#786
jaymcp wants to merge 2 commits into
stagingfrom
fix/varnish-caching

Conversation

@jaymcp

@jaymcp jaymcp commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The default implementation assumes:

  • the home page is the blog index
  • one doesn't make use of attachment pages
  • only posts and pages exist
  • only category and tag taxonomies exist
  • the base path of the REST API uses permalinks

This version reimplements path generation to
address what in my opinion are shortcomings.

Ref: https://github.com/amnestywebsite/amnesty-wp-theme/issues/3101

Steps to test:

  1. testing requires a production environment with page caching enabled, but edge page caching disabled. liaise with @jaymcp to organise one.
  2. open an incognito window, and open dev tools to the network tab. filter requests by "doc"
  3. view a post/page/petition/etc.
  4. inspect the page view request, and ensure that the cache header shows a HIT (reload if not)
  5. make & save an edit to the item in your main browser window, not the incognito one
  6. reload the incognito window
  7. cache header should show a MISS, and the updated content should show
  8. reload the incognito window
  9. cache header should show a HIT
  10. delete the item from your main browser window
  11. reload the incognito window
  12. the item should immediately 404
  13. still in the incognito window with devtools open, view a document page
  14. repeat steps 4-12 against this document

jaymcp added 2 commits July 13, 2026 12:51
The default implementation assumes:
- the home page is the blog index
- one doesn't make use of attachment pages
- only posts and pages exist
- only category and tag taxonomies exist
- the base path of the REST API uses permalinks

This version reimplements path generation to
address what in my opinion are shortcomings.
Prevents patch version breaking changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant