Workaround
Here is a relatively easy and transparent way to get around this bug:- Use VaryByCustom output cache parameter for the actions.
- Use the cache profile support to implicitly inject your VaryByCustom parameter to your output cache.
- Implement the custom parameter handling in your Global.asax.cs
This is repetitive, so we want to avoid sprinkling this custom attribute everywhere. We can use the cache profile support in your
Web.config
to add this attribute implicitly. (Just set the timeouts in your config).So, now your
OutputCache
annotation becomes:Finally, we implement the custom cache handling in the
Global.asax.cs
:
No comments:
Post a Comment