Automattic / Automattic/wp-super-cache
WP Super Cache: expose a stable URL-level cache purge API
- Dominant language
- PHP
- Stars
- 436
- Forks
- 130
- Avg merge
- 15h 11m
- Merged PRs (30d)
- 10
Description
### Impacted plugin
None / Other
### What
Expose a documented PHP API that lets third-party plugins purge the cache for a specific frontend URL with predictable scope.
### How
WP Super Cache already has URL-directed cache clearing internally through functions such as `wpsc_delete_url_cache()` and `wpsc_supercache_dir_for_url()`.
I’m the developer of Cache Autopilot, a WordPress cache freshness plugin that determines which frontend URLs are affected by a content or presentation change, passes those URLs to the active cache plugin for purging, and then preloads them again in the background.
For that integration, it would be useful if WP Super Cache exposed a documented PHP API that lets a third-party plugin pass an arbitrary frontend URL and have that URL’s cache invalidated with predictable scope and semantics.
The existing internal helpers are close, but they are difficult to treat as a stable integration contract because their behaviour depends on details such as rebuild mode, URL shape and cache-path handling.
The goal would simply be:
**third-party plugin provides a frontend URL → WP Super Cache handles invalidation of that URL through its supported cache logic**
This would keep all cache-storage and deletion logic inside WP Super Cache while allowing external plugins and automation tools to avoid unnecessary full-cache purges.
Cache Autopilot already uses this integration model with several other cache plugins, and I’d be happy to handle the integration and testing on our side or provide concrete test cases if useful.
Best wishes,
Beat
Cache Autopilot:
https://wpcacheautopilot.com/
https://wordpress.org/plugins/cache-autopilot/
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing wpsc_delete_url_cache() and wpsc_supercache_dir_for_url() helpers and tracing how rebuild mode, URL shape, and cache paths affect them. Define and document the supported URL-level purge contract, then add tests covering the agreed scope and semantics; done means third-party plugins can call the documented API without relying on internal helpers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100