Closed bbodenmiller closed 3 years ago
Hi, I see. I have mainly covered cases for caching but obviously you would like to make it easier to be able to send no-cache
and no-store
for non-cacheable stuff.
Would it work for you if I change it so that setting it to a negative number would send no-cache
and no-store
and Pragma
?
Cheers Ali
I actually don't want no-store
. What I'm looking to accomplish is to allow my response to be cached but to require revalidation on each use. If validation passes, use cached version.
https://jakearchibald.com/2016/caching-best-practices/ - pattern 2
Well, setting the value to 0 will essentially mean exactly the same: the resource can be cached but must be validated. Adding no-cache
would not make any difference.
Does this make sense?
Yes I will try that. Isn't there some minor differences like setting expires means can't be used without validation even if offline but using no-cache without express it can be used still if offline?
Well, you can use must-revalidiate
(possible via CacheCow) which does that and for stale cache it MUST retrieve - last time I checked but pretty sure.
Hi @bbodenmiller are you happy with the option provided?
I assumed you are happy due to lack of response.
I see I can do
[HttpCache(DefaultExpirySeconds = 0)]
but how can I do something like[HttpCache(NoCache = true)]
and have CacheCow setcache-control: no-cache
header?