문제

I am creating a http client cache, but I have a doubt about the no-cache field.

Official documentation says:

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. [...]

If the no-cache directive does specify one or more field-names, then a cache MAY use the response to satisfy a subsequent request, subject to any other restrictions on caching. However, the specified field-name(s) MUST NOT be sent in the response to a subsequent request without successful revalidation with the origin server.

My question is: how can I revalidate just those fields without revalidating the whole response?

도움이 되었습니까?

해결책

You should send a conditional request to the origin server and use the returned (header) fields when you get a 304 Not Modified

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top