how to improve performance of ASP.NET MVC application?

I would like to know methods to improve performance of MVC web application? To get better score on Google Page Insights

Thank you

Asked by:- jaiprakash
: 1484 At:- 6/16/2017 1:36:54 PM MVC IIS performance

1 Answers
profileImage Answered by:- vikas_jk

There are several ways to improve the performance of your MVC web-application:

  1. Caching:
    You should use caching for the images/scripts/CSS etc which will help you improve Page insight score, this is also said by Google, check

    Cache not-prone-to-change content using OutputCacheAttribute to save unnecessary and action executions.

    Use Etags.
  2. Use of Tools to check optimization Issues like
    YSlow: To get front end issue
    DotTrace: To check back discover memory leaks and performance problems in your application
  3. Use IQueryable Instead of List
  4. CheckNHibernate second level cache
  5. Remove extra View Engines:
    Add following code in your Global.asax Application_start to remove extra View engines if you are using only (.cshtml pages)
    // Removing all the view engines
    //Add Razor Engine (which we are using)
    ViewEngines.Engines.Add(new RazorViewEngine());?
  6. Add gzip (HTTP compression) and static cache in your web.config 
    <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/> 
  7. Bundle and Minify JS/CSS
  8. Try to load partial view's using Ajax, so that page loading takes small loading time.
  9. Use Asynchronous Controllers to implement actions that depend on external resources processing.
  10. Use stored procedures whenever possible.
At:- 6/16/2017 4:11:14 PM Updated at:- 6/16/2017 4:13:44 PM
good answer, I will try all these optimizations methods 0
By : jaiprakash - at :- 6/18/2017 6:25:33 AM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly