Nginx, as a development environment server, cannot clear the static file cache
大家讲道理
大家讲道理 2017-05-16 17:29:18
0
1
571

debian 6 nginx 0.7.67 (apt installation) is used as a development environment. It is found that after modifying static files (js, css, html), it cannot be updated in time, and proxy_cache is not configured
It doesn’t seem to be a problem with expires. It doesn’t work even if you change the browser (the curl command retrieves all cached files). It’s nginx that sends cached files

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
巴扎黑
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
    expires      30d;
}

location ~ .*\.(js|css)?$ {
    expires      12h;
}

This is the configuration code for js and css cache time in nginx. You can set it very small and it should be fine

You can refer to this http://www.ibm.com/developerworks/cn/...

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