我不知道Cache-Control:no-store
和Cache-Control:no-cache
之间的实际区别。
据我所知,no-store
表示不允许缓存设备缓存该响应。另一方面,no-cache
表示不允许缓存设备在未先验证来源后提供已缓存的响应。但是这个验证是关于什么的?条件get吗?
如果一个响应具有no-cache
,但没有Last-Modified
或ETag
怎么办?
谢谢。
我不知道Cache-Control:no-store
和Cache-Control:no-cache
之间的实际区别。
据我所知,no-store
表示不允许缓存设备缓存该响应。另一方面,no-cache
表示不允许缓存设备在未先验证来源后提供已缓存的响应。但是这个验证是关于什么的?条件get吗?
如果一个响应具有no-cache
,但没有Last-Modified
或ETag
怎么办?
谢谢。
但这个检查是关于什么的?
确切地说,它检查Last-Modified
或ETag
。客户端使用这些头部信息询问服务器是否有新版本的数据,如果答案是否定的,就会提供缓存数据。
更新
来自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.
Last-Modified
或ETag
怎么办? - vtortolano-cache并不意味着“不要缓存这个”(那应该是no-store)。no-cache意味着在资源重新验证新鲜度之前,不要将其用于正常加载。历史导航不属于正常加载。