Why can't Nginx cache be cleared?
漂亮男人
漂亮男人 2017-05-16 17:30:09
0
5
803

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?

漂亮男人
漂亮男人

reply all(5)
过去多啦不再A梦

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.

find /proxy/cache/path -type f -delete

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.

./configure --user=www --group=www --add-module=/root/dxm/nginx/ngx_cache_purge-1.2
世界只因有你

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!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template