zoukankan      html  css  js  c++  java
  • 46、HTTP中有个缓存机制,但如何保证缓存是最新的呢?(缓存过期机 制)

    max-age 指令出现在请求报文,并且缓存资源的缓存时间小于该指令指定的时间,那么就能接受该缓 存。

    max-age 指令出现在响应报文,表示缓存资源在缓存服务器中保存的时间。

      Cache-Control: max-age=31536000

    Expires 首部字段也可以用于告知缓存服务器该资源什么时候会过期。

      Expires: Wed, 04 Jul 2012 08:26:05 GMT

    在 HTTP/1.1 中,会优先处理 max-age 指令;

    在 HTTP/1.0 中,max-age 指令会被忽略掉。

  • 相关阅读:
    LeetCode 104
    LeetCode 100
    LeetCode 27
    LeetCode 7
    LeetCode 8
    蘑菇街2017春招笔试
    codeforces 5D
    codeforces 5C
    codeforces 875B
    codeforces 876B
  • 原文地址:https://www.cnblogs.com/crbhf/p/15115203.html
Copyright © 2011-2022 走看看