浏览 689
ngx_cache_purge
is nginx module which adds ability to purge content from FastCGI
, proxy
, SCGI
and uWSGI caches
. A purge operation removes the content with the same cache key as the purge request has.
可以通过请求URL
的方式来清理缓存,让缓存失效
syntax: proxy_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]
default: none
context: http, server, location
Allow purging of selected pages from proxy's cache.
配置案例:
http {
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;
server {
location / {
proxy_pass http://127.0.0.1:8000;
proxy_cache tmpcache;
proxy_cache_key $uri$is_args$args;
}
location ~ /purge(/.*) {
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
}
}
}
更多详见:ngx_cache_purge
按点赞数排序
按时间排序