Skip to content

Status header

Joakim Skoog edited this page Jun 17, 2017 · 2 revisions

Status header

To improve traceability of the caching process Cashew sets a custom header on each response that is returned from the HttpCachingHandler. The following values are defined:

Name Description
Hit Existed in cache, served from cache
Miss Did not exist in cache, served from origin server
Stale Existed in cache but was stale, served from cache since it was deemed acceptable to serve a stale response
Revalidated Existed in cache but was stale, revalidated by using If-None-Match or If-Modified-Since

It can be retrieved with the extension method GetCashewStatusHeader in the following way:

var status = httpResponseMessage.Headers.GetCashewStatusHeader();
Clone this wiki locally