This project is read-only.

Orchard.OutputCache and 302 response

Topics: Writing modules
Oct 14, 2013 at 8:34 AM
Hi Guys,

I've just solved a problem with caching module: my home route redirects user depending on its role using RedirectToRoute and cache module doesn't output Location header in response. I believe that's because Orchard.OutputCache.Models.CacheItem just not contain headers and cache module is not aware of them. I'm not sure if it's a bug or by design or am I missing something. Anyway a solution is to a add OutputCache attribute to my action like this:
        [OutputCache(NoStore = true, Duration = 0)]
        public ActionResult Index()
Hopefully this will help to someone.

Regards, Maxim.