欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

前端测试干掉缓存

程序员文章站 2022-05-04 12:35:26
通过配置nginx干掉 304 (from memory cache) (from disk cache) ......

 

 

通过配置nginx干掉 304  (from memory cache) (from disk cache)

 

server {
    listen 8080;
    server_name localhost;

    location / {
        root /your/site/public;
        index index.html;

        # kill cache
        add_header last-modified $date_gmt;
        add_header cache-control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        if_modified_since off;
        expires off;
        etag off;
    }
}