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 · Apr 2, 2020 · 2220 views
    This topic created in 2240 days ago, the information mentioned may be changed or developed.
    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 replies    2020-04-25 08:08:39 +08:00
    holinhot
        1
    holinhot  
    OP
       Apr 25, 2020   ❤️ 1
    rt
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3086 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:49 · PVG 18:49 · LAX 03:49 · JFK 06:49
    ♥ Do have faith in what you're doing.