zoukankan      html  css  js  c++  java
  • Why use Cache-Control header in request?

    本地缓存也是缓存代理的一部分。

    请求时使用Cache-Control 表示缓存的使用策略。

    请求头里的no-cache表示浏览器不想读缓存,并不是说没有缓存。一般在浏览器按ctrl+F5强制刷新时,请求头里就有这个no-cache,也就是跳过强缓存和协商缓存阶段,直接请求服务器。(如果直接按F5的话,请求头是max-age=0,只跳过强缓存,但进行协商缓存)
    而响应头max-age=259200 ,不太清楚,没验证出来

    http://bbs.csdn.net/topics/391022213

    There may be any number of intermediate proxies between the client and server which do caching. The client can explicitly request explicit caching behaviour from any and all caching entities, things like:

    • max-age - "I don't want a response older than X"
    • no-cache - "I want a fresh response"
    • no-transform - "I don't want it unless it's the original"
    • only-if-cached - "Don't bother the origin server if you don't have it already"

    As with all requests, servers have a certain leeway in whether to honour the request or not. Just because a client insists on an uncached response doesn't mean it's necessarily going to get it.

    https://stackoverflow.com/questions/42652931/why-use-cache-control-header-in-request

    Cache-Control: no-cache is generally used in a request header (sent from web browser to server) to force validation of the resource in the intermediate proxies. If the client doesn't send this request to the server, intermediate proxies will return a copy of the content if it is fresh (has not expired according to Expire or max-age fields). Cache-Control directs these proxies to revalidate the copy even if it is fresh.

    https://stackoverflow.com/questions/14541077/why-is-cache-control-attribute-sent-in-request-header-client-to-server

  • 相关阅读:
    (转)Python中的__init__和__new__
    PEP8
    python lstrip()函数
    python中的生成器跟迭代器
    callback
    关于0.0.0.0这个ip的疑问
    Python import中相对路径的问题
    python读取excel
    git本地管理多个密钥/账户
    词法分析之有确定、不确定自动机及其生成器
  • 原文地址:https://www.cnblogs.com/feng9exe/p/8083004.html
Copyright © 2011-2022 走看看