Best way to disable client caching

前端 未结 2 592
长发绾君心
长发绾君心 2020-12-09 23:09

I\'m using a simple servlet filter that forces the browser to skip caching for some server resources:

    Cache-Control: private
    Pragma: 

This work

2条回答
  •  隐瞒了意图╮
    2020-12-09 23:56

    Your initial solution did not work reliably because:

    • Cache control is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. The only mechanisms that I know of are proxies, so user agents are not bound by it.
    • The Pragma: header does not include a value. I'm not sure it's even legal - in terms of the HTTP protocol.

提交回复
热议问题