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

ttyx nginx-forum at nginx.us
Tue Nov 16 21:14:38 MSK 2010

I have a system handling tons of requests per second (god bless nginx).
I have 
proxy_cache_key    "$request_uri";
proxy_cache_valid  200 1s;

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.

Will it work? I mean it will of course. But will it have a potential
problem when my delete_the_file system call can interfere with the nginx
internal cache read routines?


Posted at Nginx Forum: http://forum.nginx.org/read.php?2,151218,151218#msg-151218

More information about the nginx mailing list