Open LinuxDoku opened 10 years ago
@LinuxDoku We have a similar problem. We need to update a cookie, but the action is cached, so the cookie doesn't change. How did you solve your problem?
We have no fix for this yet. ATM we`re sending a timestamp at the end of the url to disable the caching for this request.
Our trainee has implemented correct header caching in mvcdonutcaching but we had no time to code review this feature. He meant it was quite simple to develop - maybe you could give it a try.
@LinuxDoku If / once you're comfortable sharing your code, that would be awesome. I'd try! clean it up and submit it as a PR to @moonpyk.
Been digging into the codebase myself, but don't have a clue where to begin.
@irii could you commit your fix here on github? Thx, will bring some energy to the office on tuesday ;)
@LinuxDoku @irii :smiley: :beer:
@LinuxDoku @migig https://github.com/irii/mvcdonutcaching/commit/a18af56f9da8a0da9bd8689ca684acdb147519be hope it works :smiley:
@irii nice code!
Simply adding the headers to the attribute (in a semicolon separated list) is enough?
[DonutCache(CachedHeaders = "Content-Range;x-cache-item")]
Can't wait to see this in Zion ;)
@LinuxDoku @irii Ohhhh, OK, I think I understand what you did, please correct me if I'm wrong.
Your problem was that you are setting headers, but they are excluded from the cache. So your fix allows you to manually specify which headers to cache.
My problem is certain headers ARE cached, and I want them excluded. Specifically, cookies.
Your code is nice and useful though! :smiley:
Hi, I need to force server for cache a ajax request different than normal request. I used this line of code and it works, but I need an equivalent code for donut. Is it possible? [OutputCache(CacheProfile = "long", Location = System.Web.UI.OutputCacheLocation.Server, VaryByParam = "*", VaryByHeader = "X-Requested-With")]
Hello,
is it possible to cache response headers which are set via custom ActionFilter's?
Our application has a ActionFilter which set's the
Content-Range
header by inspecting the view model. This header get's lost when donut caching is serving the site from cache.Thank you!