filipw / Strathweb.CacheOutput

ASP.NET Web API CacheOutput - library to allow you to cache the output of ApiControllers
Other
882 stars 253 forks source link

Doesn't play nicely with MessageHandlers #37

Open grumpydev opened 11 years ago

grumpydev commented 11 years ago

Currently have I have a MessageHandler that decorates my models with hypermedia links. When I add the server caching options (client only is fine) then the MessageHandler runs, but the cache serves the version from before it has run (so no links).

thomasdunn commented 10 years ago

I had the same issue and solved it for myself with this hack: https://github.com/ArtOfContext/AspNetWebApi-OutputCache/commit/a2f3eb9489166daff9ec7f06b9327b701f16cf1b

Would be nice to have this native to library. @filipw - if you have a suggestion of how to handle this better let me know and I could submit. Basically from code elsewhere in web api pipeline - such as in a DelegatingHandler - I would like to update the cache that was already populated by CacheOutputAttribute without having to know the cache key, absolute expiration, etc. Perhaps adding a method to CacheExtensions.