zoukankan      html  css  js  c++  java
  • Nginx(expires 缓存减轻服务端压力)

    1. expires 是在http的回应中,也就是Response-Header,expires [time| epoch| max| pff] ,后面的设置会影响Cache-Controller, 如果是负数则 on-cache,否则就是max-age=time;

    2. 

    expires 30s; //表示把数据缓存30秒

    expires 30m;//表示把数据缓存30分

    expires 10h;//表示把数据缓存10小时

    expires 1d;//表示把数据缓存1天

    3. expires一般的都是放在http,server,location里面的,比如你设置当前目录下的图片缓存到浏览器:

      location ~ .*.(gif|jpg|jpeg|png|bmp|swf)${

        root /home/wwwroot/default;

        expires 30d;

      }

    这样,你一访问图片(127.0.0.1Jackey.png),就会自动的缓存到浏览器的了。

  • 相关阅读:
    高精度 模板
    《图论》邻接表
    模板整理
    H
    C
    同余定理的应用(处理大数
    H
    1153: 简易版最长序列
    1152: 二分搜索
    1151: 大整数加法(正数)
  • 原文地址:https://www.cnblogs.com/Jackey-fighting/p/9144010.html
Copyright © 2011-2022 走看看