I am running the nginx + PHP webservices API. I use nginx fastcgi_cache to cache all GET requests, and when some resources are updated, I clear one or more related cached resources.
The method I use for this is to calculate the nginx cache file name for each resource that I want to clear and then delete this file. For the most part, this works well.
However, I found that sometimes even after deleting the cache file, nginx will still return data from the cache.
This is not a problem with choosing the right cache file to delete - as part of my testing, I deleted the entire cache directory, and nginx still returns HIT responses
Does anyone know why this might happen? Is it possible that a different cache is involved? For example, could it be that the OS returns a cached version of the cache file in nginx, so nginx does not know that it was deleted?
I run this on CentOS and with this nginx configuration (minus the irrelevant parts):
user nginx;
Now, when I look at this, can open_file_cache parameters affect cache files?
Any ideas?
caching reverse-proxy nginx
user2943799
source share