Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

I am Jalpesh Vadgama a Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having more then 6 years of experience in .NET Technology.
Browse by Tags · View All
#ASP.NET 88
#DOTNET 87
BRH 79
ASP.NET 72
#.NET 52
C#.NET 48
DOTNET 44
ASP.NET 4.0 31
ASP.NET MVC 29
VisualStudio 27

Archive · View All
December 2010 16
July 2011 13
April 2011 13
April 2012 12
January 2011 12
June 2011 11
May 2011 11
May 2012 8
February 2013 7
January 2013 7

Output caching with ASP.NET MVC Razor

Dec 3 2010 4:15AM by Jalpesh   

Caching data greatly increase the website performance as its not going to do server round trip. I have already mentioned how you can use Output caching in web forms in earlier blog post here. Let’s see how we can do same thing with asp.net mvc. For this example I have used asp.net mvc razor. In asp.net mvc you can use OutputCache attribute to cache the output. Just like below.

[OutputCache(VaryByParam="none",Duration=60)]
public ActionResult Index()
{
     ViewModel.Message = DateTime.Now.ToString();
     return View();
}

Here it will cache the view for 60 second and will not go for server round trip. Let’s see How it will look into the browser.

Temp

You can also set the output caching in web.config and and create output cache profile which you can use any where like following.

<caching>
  <outputCacheSettings>
    <outputCacheProfiles>
      <clear/>
      <add
        name="MyOuputCacheProfile"
        duration="60"
        varyByParam="none" />
    </outputCacheProfiles>
  </outputCacheSettings>
</caching>

Here how you can use that profile.

 [OutputCache(CacheProfile = "MyOuputCacheProfile")]
 public ActionResult Index()
 {
      ViewModel.Message = DateTime.Now.ToString();
      return View();
 }

It support four type of settings for output caching. VaryByContentEncoding, VaryByParam, VaryByCustom,VaryByHeader. Hope this will help you!! happy Programming.

Shout it

Tags: C#.NET, BRH, #DOTNET, #ASP.NET, ASP.NET, Caching, Razor, ASP.NET MVC,


Jalpesh
15 · 11% · 3478
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]