How to clear / close browser cache upon logout?

In my ASP.net MVC application, I have several views that I would like to save in the browser cache. I have methods created for this, but here is my problem.

The menu on my site is different from logging in and logging in. If the login page is cached, then even when the user exits the menu, he remains in the login mode. It really isn’t, but in this visitors browser it is.

How can I clean / expire this cache so that the visitor’s browser is updated when I need it, but can I still use the browser cache?

Thanks in advance!

+3
source share
2

HTML- . . OutputCache VaryByCustom, .

, , .

: - . ( , )

.

+3

AutoRefresh . :

[AutoRefresh(ControllerName = "Home", ActionName = "About", DurationInSeconds = 10)] 
public ActionResult Index1() 
{
}
AutoRefresh(ActionName = "About", DurationInSeconds = 15)] 
public ActionResult Index2() 
{
}
[AutoRefresh(RouteName = "ByFavoriteRoute", DurationInSeconds = 30)] 
public ActionResult Index3() 
{
}
[AutoRefresh(DurationInSeconds = 45)] 
public ActionResult Index4()
{
}
0

Source: https://habr.com/ru/post/1710428/


All Articles