What if I just delete a file from cache to invalidate cache item?

Piotr Sikora piotr.sikora at frickle.com
Wed Nov 17 08:23:34 MSK 2010


Hi,

> I need to increase the cache lifetime.
> What if I set proxy_cache_valid to something large, and when my data
> changes (cache dependency), 
> I would caclulate md5(request_uri) and go to
> /my_nginx_cache_dir/a/ab/abc..... and just delete the corresponding
> cache item.

You should really look into ngx_cache_purge module:
http://labs.frickle.com/nginx_ngx_cache_purge/

Best regards,
Piotr Sikora < piotr.sikora at frickle.com >




More information about the nginx mailing list