zoukankan      html  css  js  c++  java
  • 详细解释:nginx中ngx_http_headers_module模块配置及各个参数含义


    本模板可以设置HTTP报文的头标。

    __示例__:

    : expires     24h;
    : expires     0;
    : expires     -1;
    : expires     epoch;
    : add_header  Cache-Control  private;


    指令
    [#add_header add_header]
    [#expires expires]


    增加头标
    语法: add_header name value

    默认值: none

    作用域: http, server, location

    当HTTP应答状态码为 200、204、301、302 或 304 的时候,增加指定的HTTP头标。

    其中头标的值可以使用变量。

    expires
    语法: expires [time|epoch|max|off]

    默认值: expires off

    作用域: http, server, location

    使用本指令可以控制HTTP应答中的“Expires”和“Cache-Control”的头标,(起到控制页面缓存的作用)。

    可以在time值中使用正数或负数。“Expires”头标的值将通过当前系统时间加上您设定的 time 值来获得。

    epoch 指定“Expires”的值为 1 January, 1970, 00:00:01 GMT。

    max 指定“Expires”的值为 31 December 2037 23:59:59 GMT,“Cache-Control”的值为10年。

    -1 指定“Expires”的值为 服务器当前时间 -1s,即永远过期

    “Cache-Control”头标的值由您指定的时间来决定:

    负数:Cache-Control: no-cache
    正数或零:Cache-Control: max-age = #, # 为您指定时间的秒数。
    "off" 表示不修改“Expires”和“Cache-Control”的值

    原始文档:http://sysoev.ru/nginx/docs/http/ngx_http_headers_module.html

  • 相关阅读:
    hdu-5569 matrix(dp)
    hdu-5780 gcd(数学)
    hdu-5778 abs(暴力枚举)
    hdu-5777 domino(贪心)
    hdu-5776 sum(同余)
    polymer-quick tour of polymer
    polymer-developer guide-feature overview
    polymer技巧
    polymer入门例子-已过时
    polymer-developer guide-registration and lifecycle
  • 原文地址:https://www.cnblogs.com/jessonlv/p/4388063.html
Copyright © 2011-2022 走看看