Use Nginx as a static resource server, but found a tragedy.
I have updated the resource file in the root directory. It is a css file, but it is still old when I access it.
It's definitely not the browser cache, I just changed the browser. . .
Nginx doesn't work even after restarting. Why is Nginx cache so weird? What should I do?
First of all, you must have configured proxy_cache_path. If nginx does not configure this parameter, it will not cache any files.
To clear the configuration, delete all files in the directory configured by proxy_cache_path.
Restarting Nginx is useless
nginx’s caching service proxy_cache cannot clear the specified URL cache. It can only set the URL expiration time. To clear the specified URL, you can use the nginx third-party module ngx_cache_purge.
When installing nginx, you need to load ngx_cache_purege into it.
Use memc-nginx and srcache-nginx modules to build efficient and transparent caching mechanism
http://www.qixing318.com/article/using-memc-nginx-and-srcache-nginx-module-build-efficient-and-transparent -caching-mechanism.html
If you are using virtualBox, this may be the reason
VirtualBox Hates Sendfile
Modify configuration sendfile off;
Thank you upstairs! Mine was caused by this problem. After changing sendfile to OFF, it was fine!