How to update only one property of an object using OutputCache in ActionResult

1

Hello, everyone.

I have a problem that I do not even know if there is a solution like this.

I have an ActionResult that returns the contents of a chart in Jquery.

The result of this graphic will always need to be cached so page does not get 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 properly I would need to ONLY remove this cache PROPERTY

[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.userLogic' property would have to be out of cache. Is there any way to do this? Because it is always false.

    
asked by anonymous 27.09.2017 / 19:11

0 answers