aliostad / CacheCow

An implementation of HTTP Caching in .NET Core and 4.5.2+ for both the client and the server
MIT License
847 stars 172 forks source link

Invalidating or overwriting a cached object? #256

Closed alexkozler closed 3 years ago

alexkozler commented 3 years ago

Let me describe my ASP.NET WebAPI scenario:

  1. Alex sends a message to a group of people, including Bill
  2. Bill does an HTTP GET to /message/get to fetch this message. This request's response is cached.
  3. Alex edits the message he sent in step 1
  4. Sam issues a /message/get to fetch the same message

In step #4 would Sam get the old message or the edited message? How do you invalidate/replace what the cache contains so that subsequent users don't get an outdated copy of the message prior to it's cached response expiring?

aliostad commented 3 years ago

Apologies, as this was somehow lost and did not see it until now.

This is a generic question best asked in the forums. This has nothing specific to CacheCow.

Having said that, I am happy to help you but you have given zero information on where this is being cached. Do you mean a Cache proxy? Then depends on the proxy - CacheCow only support cache for the HTTP Client.

aliostad commented 3 years ago

No response.