I'm trying to tune up my MVC3 application that uses a lot of jquery libraries, including jqGrid.
I'd be interested to hear your best practices and performance tips and tricks if any. What you normally do for 'most' MVC3 based applications as a given.
Thank you
If tune means better loading you can do these 3 things. You could optimize the loading time up to 80% with theese techniques.
I suggest to use Fiddler2 to see how your changes perform.
OutputCache
Attribute if possibleViewEngines
MSDN: OutputCacheAttribute Class
[OutputCache(Duration=60)]
public ActionResult Index()
{
return View();
}
do this in global.asax
protected void Application_Start()
{
// other stuff
ViewEngines.Engines.Clear();
// if you only use RazorViewEngine
ViewEngines.Engines.Add(new RazorViewEngine());
// if you only use WebFormViewEngine
ViewEngines.Engines.Add(new WebFormViewEngine());
}
Following the Yahoo recommendations is a great way to optimize and speedup a website. Some of the tips are very easy to implement and could bring considerable performance gains.
Google have also published some great resources that I strongly invite you to read.
Combining and minifying your scripts is a great start to cut down the response size and number of requests. Also, be sure not to include uneccessary plugins and code that won't be used on particular pages...
Article on the topic:
http://www.hanselman.com/blog/TheImportanceAndEaseOfMinifyingYourCSSAndJavaScriptAndOptimizingPNGsForYourBlogOrWebsite.aspx
For performance tuning on the server-side check out the Mini Profiler
tool created and used by SO:
http://code.google.com/p/mvc-mini-profiler/
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