V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
holinhot
V2EX  ›  NGINX

nginx cache purge 泛清除问题

  •  
  •   holinhot · 2020-04-02 20:01:38 +08:00 · 1491 次点击
    这是一个创建于 1456 天前的主题,其中的信息可能已经有所发展或是发生改变。
    nginx 不像 ATS 支持强大的正则删除缓存规则。找了一个模块看了下 https://github.com/FRiCKLE/ngx_cache_purge 这个看了下只支持绝对 url 清除缓存,并不支持 /image/*这种方式清除,这就很不方便了。

    另外看到一个 https://github.com/diego-treitos/nginx_cache_multipurge 这个支持泛清除。一看源代码基本是遍历删除的路子啊
    os.execute( "find '"..cmp_cache_path.."' -name '"..cache_key_md5.."' -type f -exec rm {} + -quit" )

    难道 nginx 泛 purge 都只能通过遍历实现吗?上亿文件这根本不行啊。ATS 似乎有他自己的文件系统,所以实现泛 purge 应该不需要遍历
    1 条回复    2020-04-25 08:08:39 +08:00
    holinhot
        1
    holinhot  
    OP
       2020-04-25 08:08:39 +08:00   ❤️ 1
    rt
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2901 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:23 · PVG 19:23 · LAX 04:23 · JFK 07:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.