1
Hello, everybody.
I’ve got a problem I don’t even know if there’s a solution like this.
I have an Actionresult that returns the contents of a chart in Jquery.
The result of this chart will always need to be stored in a cache so that the page is not heavy.
Only a property of this model that needs to return true or false depending on whether the user is logged in or not.
For it to update correctly I would need to remove ONLY THIS PROPERTY from the cache
[OutputCache(Duration = 3600, VaryByCustom ="none")]
public ActionResult Index()
{
GraficosModel model = geradorGraficos.GerarGrafico();
if (this.UsuarioPesquisa != null)
{
model.usuarioLogado = true;
}
else
{
model.usuarioLogado = false;
}
return View(model);
}
This 'model.user' property would have to be outside the cache. Is there any way to do this? Because it is always bringing false.
Why should you put the Logged in user into an object? Session would not solve?
– Cassio Alves
the way the application was made so is already this way
– Rafaela Marraschi