Don't cache the response message

Topics: Customizing Orchard, General
Mar 8, 2015 at 9:46 PM

On my frontpage I have added a subscribe form for newsletter using custom forms. All good. When user submits email addess, message is displayed saying "thank you....".

When I than navigate to other links on my page and return back, the message is still there. Looking at the cache time, which by default is 300 seconds, this means that the site is cached, and thereby the message is also cached. Cleaning the cache, or setting 0 in cache time, the message is not displayed more than once.

So my question is; is there a setting for not caching the message (I would love to cache the other part of the site) ?
Mar 9, 2015 at 2:43 PM
Is that message created through the INotifier service? If so, which Orchard version are you running? The OutputCacheFilter should not cache the page if it contains messages created through the INotifier.
Mar 9, 2015 at 3:28 PM
I'm not sure about that, but I could try to debug to see if it's using INotifier.

But to be precise, I have not developed anything custom (no custom code / module). I'm just using default Custom Forms module and Custom Forms Widget described here link to set up my form. Sorry if I was unclear about that.

I have tested this on the latest master repo source which is I have one form with one input field of type email, whic is mandatory. I have put ut in the Azure, but I get the same result locally.

It can be tested here: link. Just add en email and push submit. A message apears. Then go to page 2, and back to front page. The messasge is still there. Push refresh nothing happens to the message.
Mar 9, 2015 at 3:49 PM
I see. then it must be using the INotifier. Can you try with 1.x, just to see if the problem was fixed there?
Mar 10, 2015 at 11:46 PM
Hi, tried the v 1.8.x, seems that the problem is fixed there. I'll try 1.x later on, but I see that 1.x was merged into 1.8.x five days ago so I suppose it is working.
Mar 18, 2015 at 3:32 AM
Interesting story for this issue, for more details see at the end of this recent workitem
Here, there is the opposite scenario where an admin notification prevents caching

But, indeed, this issue has been resolved and I hope the code will not revert back to a previous version