Purging should happen async #165
Labels
impact: high
Unblocks new use cases, substantial improvement to existing feature, fixes a major bug
type: enhancement
Improvements to existing functionality
Problem
Currently, when WPGraphQL Smart Cache determines that there are queries to purge, it kicks off a foreach loop and purges them.
This is happening during a user session (typically when saving/publishing a post), causing slowdowns.
This screenshot was provided by a user showing their "publish/update" actions in the admin taking a while.
Proposal
I believe that instead of purging the caches immediately, we refactor this to happen async.
We determine which caches to purge and place them in a "queue", then send off a non-blocking HTTP request back to WordPress which would then work through that queue and purge the caches.
This will allow for users to publish/update content without having to wait for the purge action to complete.
The text was updated successfully, but these errors were encountered: