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

  • 相关阅读:
    spring boot RESTfuldemo测试类
    再谈Redirect(客户端重定向)和Dispatch(服务器端重定向)
    HTTP协议解析
    HTTP协议详解(真的很经典)
    JMeter进行简单的数据库(mysql)压力测试
    LoadRunner利用ODBC编写MySql脚本
    性能瓶颈的分析
    bug的处理流程
    Loadrunner11 录制手机App脚本多种方法介绍
    利用fiddler录制脚本
  • 原文地址:https://www.cnblogs.com/feng9exe/p/8083004.html
Copyright © 2011-2022 走看看