Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purging should happen async #165

Open
jasonbahl opened this issue Aug 18, 2022 · 0 comments
Open

Purging should happen async #165

jasonbahl opened this issue Aug 18, 2022 · 0 comments
Assignees
Labels
impact: high Unblocks new use cases, substantial improvement to existing feature, fixes a major bug type: enhancement Improvements to existing functionality

Comments

@jasonbahl
Copy link
Collaborator

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.

Screenshot 2022-08-18 at 08 42 36

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.

@jasonbahl jasonbahl added type: enhancement Improvements to existing functionality impact: high Unblocks new use cases, substantial improvement to existing feature, fixes a major bug labels Aug 18, 2022
@jasonbahl jasonbahl self-assigned this Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: high Unblocks new use cases, substantial improvement to existing feature, fixes a major bug type: enhancement Improvements to existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant