HTTP协议的cache-control常见取值及其组合释义:
no-cache:数据内容不被客户端缓存,每次请求都重新访问服务器,若有mac-age,则缓存期间不访问服务器
no-store:不仅不能缓存,连暂存也不可以(临时文件夹中不能暂存该资源)
private(默认):只能在浏览器中缓存,只有第一次请求的时候才访问服务器,若有max-age,则缓存期间不访问服务器
public:可以被任何缓存区缓存,如,浏览器,服务器,代理服务器等
max-age:相对过期试驾,即以秒为单位的缓存时间
no-cache,private:打开新窗口时候重新访问服务器,若设置max-age,则缓存期间不访问服务器
private,正数的max-age:后退的时候不会访问服务器
no-cache,正数的max-age:后退时候会访问服务器
点击刷新:无论如何都会访问服务器
Expires:
设置以分钟为单位的绝对过期时间,优先级比Cache-Contro低,同时设置Expires和Cache-Control则后者生效;

例如配置,将html结尾的请求加上no-cache;

即在此请求的location内加上如下配置即可

location / {
    access_log /data/nginx/log/xxx.log api;
    root /home/www/html;
    if ($request_filename ~ .*\.(htm|html)$)
     {
            add_header Cache-Control no-cache;
     }
}