This project is read-only.

Redirect problem with OutputCache in Chrome and firefox

Topics: Core, General, Writing modules, Writing themes
Apr 19, 2014 at 9:12 AM
I have a contact module. I have a contact form in ~/contactus page. It sends input information to contact controller then Create Action method of this controller makes contact record then creates notification (INotifier) then uses RedirectResult (or RedirectLocal) for redirecting to ~/contactus.

The problem is redirect result must not be cached BUT i get cached version of ~/contactus page after redirection therefore notification does not appear. (If i hit Ctrl+F5, I can see notification)

This problem does not exist in IE 11. Also if i enter ~/contactus in ignoredUrls for OutputCache module there is no problem. Therefore i think problem is server side.
Apr 22, 2014 at 2:30 PM
Any suggestions?
Why OutputCache module does not work correctly on redirect?
Apr 22, 2014 at 2:32 PM
I have the same problem.
Apr 22, 2014 at 2:50 PM
I do not think that you need OuputCache for ContactUs page. If you think that you need, then you should add sth - a query string maybe - in order the 2 pages to be distinct. Otherwise, OutputCache cannot understand the difference.
Apr 23, 2014 at 11:27 AM
@armanforghani Thank you so much for confirmation.
@urbanit Thank you so much for your reply. I believe caching is useful for all page including contact us. Also please check code of OutputCache module. It can understand redirection. Also random string in url is not good idea specially in MVC.
May 11, 2014 at 12:59 AM
This problem is very hard. Do you really use Orchard in operational environment? How?
I reported the big problem but i didn't heard any answer.

Simply add comment part to Page content type. When any anonymous user submit comment, The user cannot see any notification because user get cache copy page even after posting data and redirect to return url. Do you advise me that i add all pages that have comment part in ignored urls?
Output Cache module with this behavior can be fun only.