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

Failed to purge a cached POST method by key #40

Open
yuriylygin opened this issue Feb 16, 2022 · 0 comments
Open

Failed to purge a cached POST method by key #40

yuriylygin opened this issue Feb 16, 2022 · 0 comments

Comments

@yuriylygin
Copy link

That is what I have to initiate cache:

uwsgi_cache vsp-cache;
uwsgi_cache_lock on;
uwsgi_cache_lock_timeout 5s;
uwsgi_cache_valid 15m;
uwsgi_cache_key "$role:$proxy_host$uri$is_args$args:$request_body_md5";
uwsgi_cache_methods GET HEAD POST;

As it is shown I cache not only GET and HEAD methods but POST methods as well.

Purging is realized in a separate location with a key being passed within the url path:

location ~ ^/purge/develop/(.*) { #text
    allow              127.0.0.1;
    uwsgi_cache_purge  vsp-cache $1;
}

When I try to purge a cached GET request with the key associated with that request everything works just fine and the cached request is removed. But the same logic doesn't work when I try to purge a cached POST request. I get a response with 412 status code which means the key is not found I suppose.

The question is how to purge a cached POST request from NGINX cache with a key passed in the url path?

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

No branches or pull requests

1 participant