Skip to content

Failed to purge a cached POST method by key #40

@yuriylygin

Description

@yuriylygin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions