Cache-control中no-cache和no-store之间有什么区别? [英] What is the difference between no-cache and no-store in Cache-control?

查看:810
本文介绍了Cache-control中no-cache和no-store之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有找到 Cache-Control:no-store Cache-Control:no-cache

据我所知, no-store 表示不允许任何缓存设备进入缓存该响应。另一方面, no-cache 意味着不允许缓存设备提供缓存响应,而不首先使用源验证它。但那个验证是什么?条件获取?

As far as I know, no-store means that no cache device is allowed to cache that response. In the other hand, no-cache means that no cache device is allowed to serve a cached response without validate it first with the source. But what is that validation about? Conditional get?

如果响应具有 no-cache ,但它没有,该怎么办? Last-Modified ETag

What if a response has no-cache, but it has no Last-Modified or ETag?

问候。

推荐答案


但那是什么检查?

But what is that check about?

正确检查 Last-Modified ETag 。客户端会询问服务器是否有使用这些标头的新版本数据,如果答案为否,它将提供缓存数据。

Exactly checking Last-Modified or ETag. Client would ask server if it has new version of data using those headers and if the answer is no it will serve cached data.

更新

来自 RFC

no-cache
    If the no-cache directive does not specify a field-name, then a cache MUST NOT use
 the response to satisfy a subsequent request without successful revalidation with the
 origin server. This allows an origin server to prevent caching even by caches that   
 have been configured to return stale responses to client requests. 

这篇关于Cache-control中no-cache和no-store之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆