Pregunta

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top