I'm writing a standard MVC 5 application, and set OutputCache tag on the controllers, also installed StackExange.Redis and RedisOutputCache. Configured the web.config accordingly.
The cache works perfectly when I Run this in localhost, however once deployed into an Azure WebApp, the cache doesn't work as I See the changes coming through. Also when debugging the App remotely, i see the breakpoint hits in the controller view action.
I have been looking for days for a solution, but I could not find any answer, not even something similar. I already raised a ticket on Azure Support.
So my questions is, is there something that could make the Azure WebApp behave differently from the local solution? How could I debug Outputcache to check why it doesn't hit the cached version?
Additional info: I see in the Redis Cli the that Outputcache is storing the cached version, it's just it doesn't return it.
Thanks
Well, I finally found the issue.
I was using Thread.CurrentThread.CurrentCulture.Name
in the VaryByCustomString()
function in global.asax
to create a culture based cached version.
However, once deployed to Azure WebApp this culture appears to be not set, so the check fails and the OutputCache
thinks there isn't any version in Redis.