[OpenResty]使用nginx lua清除proxy cache,openrestynginx


分享2篇文章,介绍了nginx proxy cache的原理,以及怎么使用lua做 cache purge, 包括单一url的清除,特别的支持了通配符的purge操作。

文章

  • https://scene-si.org/2016/11/02/purging-cached-items-from-nginx-with-lua/
  • https://scene-si.org/2017/01/08/improving-nginx-lua-cache-purge/

代码

gist 需要梯子,为了方面,搬运过来了。 有时间会补充个case

做了个demo,用来调试和测试,安装好openresty就可以调试了。地址为
https://github.com/orangle/openresty-proxy-purge-example

单个文件的purge 还有带通配符的purge,2种情况。

相关内容

    暂无相关文章