5.2.1.7. only-if-cached

1 阅读1分钟

5.2.1.7. only-if-cached

rfc 7234 5.2.1.7. only-if-cached

The "only-if-cached" request directive indicates that the client only
   wishes to obtain a stored response.  If it receives this directive, a
   cache SHOULD either respond using a stored response that is
   consistent with the other constraints of the request, or respond with
   a 504 (Gateway Timeout) status code.  If a group of caches is being
   operated as a unified system with good internal connectivity, a
   member cache MAY forward such a request within that group of caches.

指令含义

如果有满足rfc 7234 4.1定义的reuse条件的stored response,就返回给我;否则返回504给我。

显然,在实现cache时,only-if-cached指令的执行需要在reuse判定结束以后。