0
I am using Outputcache in an Asp.net mvc5 application to cache a list in my application as follows :
[(Duration = 60, VaryByParam = "none")]
public ActionResult Index()
{}
I just need to take advantage of this cache while the user is logged in to the application. ie I’ll just upload the list again in the new user login.
how can I define this?
But in the case would still have the duration of 60ms in the declaration, and that time does not have to be parameter while the user is logged in takes advantage it draws ? What is confusing for me, because I am obliged to declare this time.
– Gabriel Rodrigues
The cache time will never beat the session time. Even if the session has an equal timeout, it can be renewed. If you use a higher parameter in
Duration
would work well, but still does not expire along with the session. If you want to be exactly the same as the session, it is easier to put the result of theAction
in the session.– Ricardo Pontual