Closed patelbinal closed 3 years ago
@patelbinal I had the same issue and this library prior to 5.0.0-beta was implemented with that behaviour.
However, read #82 where it was changed based on the Mozilla documentation. Bottom line is that etag and date modified headers are evaluated independently.
The implementation change is here: https://github.com/KevinDockx/HttpCacheHeaders/blob/master/src/Marvin.Cache.Headers/HttpCacheHeadersMiddleware.cs#L249
Currently, I have reverted to using no-store
which as it turns out is really the life cycle of my affected resources.
Hi Team,
I want to implement HTTP caching for my less frequent updating resources with the use of this package. I do have only GET endpoints in my resources let say "years", No PUT endpoint is there. This "years" resource is getting updated a once between 2-3 months period, by few backed activities (Not from the API).
So, I am thinking to use only expiration models. So, after some time the cached response gets expired and it gives me a new response from the server. It is fine if, for some amount of time, I get the stale response until it gets expired. So, I have kept the MaxAge to 120 seconds only, so after 120 seconds response gets expired automatically and the subsequent request is served as a fresh request from the server itself.
Just to inform, my cache location is public (Shared cache) which is shared across multiple clients.
Code snippet for startup file. I am configuring this in the API gateway level, not each service level.
And injecting this middleware by
app.UseHttpCacheHeaders();
Request headers :
Response headers:
Request headers:
Response Headers:
Please help here and let me know which point I am missing on my end.
Do I need to add the validation model options as well with "MustRevalidate" as true which re validates and fires the new requests to the Server?