Asp.Net Outputcache Webconfig Ayarları
[OutputCache(CacheProfile = "MyCacheProfile", VaryByParam = "strContentName", VaryByCustom = "userName")]
public ActionResult Detail() //Controller
{ } [OutputCache(CacheProfile = "MyCacheProfile", VaryByParam = "None", VaryByCustom = "userName")] public ActionResult Detail() //Controller { } ------------------------------------- WEBCONFIG TARAFI <!--caching--> <caching> <outputCacheSettings> <outputCacheProfiles> <add name="MyCacheProfile" duration="600" location="Server" enabled="true"/> </outputCacheProfiles> </outputCacheSettings> </caching> <!--caching--> ------------------------------------- şeklinde bir arada kullanılabilir
Asp.NET tarafı hangi cs ye yazılacak.
YanıtlaSilController içerisinde Cache'i uygulamak istediğiniz metod üzerine aşağıdaki şekilde attribute'ü eklemeniz yeterli.
YanıtlaSil[OutputCache(CacheProfile = "MyCacheProfile", VaryByParam = "strContentName", VaryByCustom = "userName")]