zoukankan      html  css  js  c++  java
  • nginx*缓存提速

    https://www.iteye.com/blog/836811384-1977332

    http{
        proxy_cache_path  /opt/cache  levels=1:2 keys_zone=STATIC:10m inactive=96h max_size=40g;  
        server {
            listen 81; 
            #location ^~ /
            location /img {  
                proxy_pass             http://server.usa.com;  
                proxy_set_header       X-Forwarded-For $proxy_add_x_forwarded_for;  
                proxy_cache            STATIC;  
                proxy_cache_valid      200  10d;  
                proxy_cache_use_stale  error timeout invalid_header updating http_500 http_502 http_503 http_504;  
            }
        }
    }

    提速明显。

    proxy_cache_path /tmp levels=1:2 keys_zone=cache_one:500m inactive=1d max_size=30g;
    
    add_header Cache-Control 'public';
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_cache cache_one;
    proxy_cache_valid  200 206 304 180d; 
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;

    参考:

    https://www.cnblogs.com/f-ck-need-u/p/7684732.html

    https://www.cnblogs.com/chenpython123/p/11974576.html

    https://www.cnblogs.com/redirect/p/10066766.html#23-proxy_cache

    http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache

  • 相关阅读:
    vue系列——数据请求
    优化记录
    优化记录
    正则
    跨域问题
    原型链之prototype/__proto__/constructor
    vue系列——组件数据通讯(二)
    vue系列——组件数据通讯(一)
    ES6(一)
    ES5总结
  • 原文地址:https://www.cnblogs.com/tekikesyo/p/15539907.html
Copyright © 2011-2022 走看看