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

  • 相关阅读:
    第3次实践作业
    第2次实践作业
    第09组 团队Git现场编程实战
    第二次结对编程作业
    团队项目-需求分析报告
    团队项目-选题报告
    第一次结对编程作业
    第一次个人编程作业
    第一次博客作业
    课程设计第十四天
  • 原文地址:https://www.cnblogs.com/feng9exe/p/8083004.html
Copyright © 2011-2022 走看看