I’m developing a messaging system for a website.
When user clicks on a message in Inbox, she goes to an individual message view that allows to reply to it.
Now, imagine she clicks ‘Back’ right after seeing individual message. She’ll see the inbox, but the message will still be highlighted as unread because the page has been cached.
What is the standard and recommended way to solve this in ASP .NET MVC?
The standard way is to tell the webbrowser to reload the page from the server using meta tags.
A combination of something like
Usually works if you can insert in the header in your view.
You can also configure these attributes via
Response.Cachein your controller so that they are passed in the HTTP header.A more MVC-style option is to specify these headers using
OutputCacheattribute withNoStore = true:which does exactly the same thing.