I Have an module in one application that loads the list of items in dropdown depending if these items are set true of checked in system settings.
When certain item is set to yes, this item should automatically be part of the dropdown choices. This PERFECTLY WORKS in Google Chrome and other browsers but NOT in Internet Explorer.
I thought of cache problem since i experience the same in previous projects.
i just include this above the action in controller
[OutputCache(NoStore = true)]
Tried the same now in ASP.Net Core MVC
But having a "namespace "OutputCacheAttribute" could not be found.
The output cache enables you to cache the content returned by a controller action. That way, the same content does not need to be generated each and every time the same controller action is invoked. Imagine, for example, that your ASP.NET MVC application displays a list of database records in a view named Index.
In ASP.NET MVC, there is an OutputCache filter attribute that you can apply and this is the same concept as output caching in web forms. The output cache enables you to cache the content returned by a controller action. Output caching basically allows you to store the output of a particular controller in the memory.
There is a property of the OutputCache attribute 'Location' with following possible values: Any (Default): Content is cached in three locations: the web server, any proxy servers, and the web browser. Client: Content is cached on the web browser. Server: Content is cached on the web server.
It allows varying the cached output by GET query string or form POST parameters. For instance, you can vary the user-control output to the cache by specifying the user-control name along with either a query string or a form POST parameter. For more information, see Caching Multiple Versions of User Control Output.
You can use
[ResponseCache(VaryByHeader = "User-Agent", Duration = 30)]
public IActionResult About2()
{
return Ok();
}
MSDN link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With