1
I recently started studying the OutputCache
and its uses due to a use in a corporate system.
I’m using the OutputCache
to load all menus that a user (logged in) will have access to. However, I want that every login he reload this method again (action), regardless of whether the time (Duration) sold out or not...
Does anyone know if I can do this via override GetVaryByCustomString
in the Global.asax
? If yes, how?
Hugs!
So that’s what I’m doing. But what I want is that if I change the access of a user’s menu, (I take the access to the 'configuration' menu for example), I want that when logging out, and later the login, my 'actionresult Menu()' will run again, regardless of whether Duration has run out or not...
– Antônio Filho
@Antôniofilho I updated the answer.
– Leonel Sanches da Silva
So, I imagined this... I’ll end up putting in Login, in [Get]. This option is really the only one?
– Antônio Filho
It’s by Custom String, but it serves more for a global scope, which is not your case.
– Leonel Sanches da Silva
Sure, I get it. But that’s right! So you don’t even have to use 'override Getvarybycustomstring' in 'Global.asax'... I’ve seen a lot of people talk about using this method, but theoretically it doesn’t even make sense...
– Antônio Filho
Exactly, but not everyone is looking for a more suitable solution. I’m glad it worked!
– Leonel Sanches da Silva