asp.net - Disabling caching for MVC Controller Action -
i know can write custom actionfilter
asp.net mvc controller
action
set headers in response disable caching.
my question is, there out-of-the-box actionfilter
in mvc bcl this? or must have create own custom one?
you can use [outputcache]
filter:
[httpget] [outputcache(location = outputcachelocation.none, nostore = true)] public actionresult index() { // .... return view(); }
see msdn
Comments
Post a Comment