-
Notifications
You must be signed in to change notification settings - Fork 312
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
Feature: option to purge all the cached content #33
base: master
Are you sure you want to change the base?
Conversation
This option can be slow if a lot of content is cached, or if the storage used for the cache is slow. But you really should be using RAM as your cache storage. Signed-off-by: Francisco Miguel Biete <[email protected]> <[email protected]>
This is indeed good addition! |
This feature is interesting but I don understand the setup: With these conf
Which URL you have to call to purge the whole cache ? |
With that config you should use:
You can check the examples in the t/proxy3.t file |
So is the very same I should use to purge the homepage right ? IMHO you should work in another way (didn't check the conf but I hope the idea is clear)
So to purge one of you application URL use
to purge all the cache
Does it make sense ? |
Of course, a "real" configuration should look like your example: existing location to purge individual pages, alternative non-existent location to purge_all, and another to purge using wildcards. The code accepts both of them; since it's a matter of configuration it is up the user to choose what they prefer to do. |
This option can be slow if a lot of content is cached, or if the storage used for the cache is slow. But you really should be using RAM as your cache storage. Signed-off-by: Francisco Miguel Biete <[email protected]> Signed-off-by: Francisco Miguel Biete <[email protected]> Resolved FRiCKLE#33 Resolved FRiCKLE#35
Put an '*' at the end of your purge cache URL. e.g: proxy_cache_key $scheme$host$uri$is_args$args$cookie_JSESSIONID; curl -X PURGE https://example.com/pass* This will remove every cached page whose key cache starting with: httpsexample.com/pass* Be careful not passing any value for the values after the $uri, or put it at the end of your cache key. Signed-off-by: Francisco Miguel Biete <[email protected]> Signed-off-by: Francisco Miguel Biete <[email protected]> Resolved FRiCKLE#33 Resolved FRiCKLE#35
I think a separated directory option
usage:
|
This adds an optional option (purge_all) to the purge_cache configuration, so if this special location is called the whole cache will be cleared.
I'm new to nginx development, and the documentation is zero, so I'm sure there is a better solution. If you can improve it, suggestions/reviews are very welcomed.