Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A compiled list of possible sources of improvement are below:</p> <p><strong>General</strong></p> <ul> <li>Make use of a profiler to discover memory leaks and performance problems in your application. personally I suggest <a href="http://www.jetbrains.com/profiler/" rel="noreferrer">dotTrace</a></li> <li>Run your site in Release mode, not Debug mode, when in production, and also during performance profiling. Release mode is much faster. Debug mode can hide performance problems in your own code.</li> </ul> <p><strong>Caching</strong> </p> <ul> <li>Use <code>CompiledQuery.Compile()</code> recursively avoiding recompilation of your query expressions</li> <li>Cache not-prone-to-change content using <code>OutputCacheAttribute</code> to save unnecessary and action executions</li> <li>Use cookies for frequently accessed non sensitive information</li> <li>Utilize <a href="http://www.google.co.uk/search?q=asp.net+mvc+etag" rel="noreferrer">ETags</a> and expiration - Write your custom <code>ActionResult</code> methods if necessary</li> <li>Consider using the <code>RouteName</code> to organize your routes and then use it to generate your links, and try not to use the expression tree based ActionLink method. </li> <li>Consider implementing a route resolution caching strategy</li> <li>Put repetitive code inside your <code>PartialViews</code>, avoid render it <em>xxxx</em> times: if you end up calling the same partial 300 times in the same view, probably there is something wrong with that. <a href="http://codeclimber.net.nz/archive/2009/04/17/how-to-improve-the-performances-of-asp.net-mvc-web-applications.aspx" rel="noreferrer">Explanation And Benchmarks</a></li> </ul> <p><strong>Routing</strong></p> <ul> <li><p>Use <code>Url.RouteUrl("User", new { username = "joeuser" })</code> to specify routes. <a href="http://www.slideshare.net/rudib/aspnet-mvc-performance" rel="noreferrer">ASP.NET MVC Perfomance by Rudi Benkovic</a></p></li> <li><p>Cache route resolving using this helper <code>UrlHelperCached</code> <a href="http://www.slideshare.net/rudib/aspnet-mvc-performance" rel="noreferrer">ASP.NET MVC Perfomance by Rudi Benkovic</a></p></li> </ul> <p><strong>Security</strong></p> <ul> <li>Use Forms Authentication, Keep your frequently accessed sensitive data in the authentication ticket</li> </ul> <p><strong>DAL</strong></p> <ul> <li>When accessing data via LINQ <a href="https://stackoverflow.com/questions/1106802/why-use-asqueryable-instead-of-list">rely on IQueryable</a></li> <li><a href="https://stackoverflow.com/questions/1223194/loading-subrecords-in-the-repository-pattern">Leverage the Repository pattern</a></li> <li>Profile your queries i.e. <a href="http://hibernatingrhinos.com/products/UberProf" rel="noreferrer">Uber Profiler</a></li> <li>Consider second level cache for your queries and add them an scope and a timeout i.e. <a href="http://nhibernate.info/blog/2009/02/09/quickly-setting-up-and-using-nhibernate-s-second-level-cache.html" rel="noreferrer">NHibernate Second Cache</a> </li> </ul> <p><strong>Load balancing</strong></p> <ul> <li><p>Utilize reverse proxies, to spread the client load across your app instance. (Stack Overflow uses <a href="http://haproxy.1wt.eu/" rel="noreferrer">HAProxy</a> (<a href="http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006676" rel="noreferrer">MSDN</a>).</p></li> <li><p>Use <a href="http://msdn.microsoft.com/en-in/library/ee728598(v=vs.98).aspx" rel="noreferrer">Asynchronous Controllers</a> to implement actions that depend on external resources processing.</p></li> </ul> <p><strong>Client side</strong></p> <ul> <li>Optimize your client side, use a tool like <a href="http://developer.yahoo.com/yslow/" rel="noreferrer">YSlow</a> for suggestions to improve performance</li> <li>Use AJAX to update components of your UI, avoid a whole page update when possible.</li> <li>Consider implement a pub-sub architecture -i.e. Comet- for content delivery against reload based in timeouts.</li> <li>Move charting and graph generation logic to the client side if possible. Graph generation is a expensive activity. Deferring to the client side your server from an unnecessary burden, and allows you to work with graphs locally without make a new request (i.e. Flex charting, <a href="http://www.workshop.rs/jqbargraph/" rel="noreferrer">jqbargraph</a>, <a href="http://www.reynoldsftw.com/2009/02/6-jquery-chart-plugins-reviewed/" rel="noreferrer">MoreJqueryCharts</a>).</li> <li>Use CDN's for scripts and media content to improve loading on the client side (i.e. <a href="http://code.google.com/apis/ajaxlibs/documentation/" rel="noreferrer">Google CDN</a>)</li> <li>Minify -<a href="http://code.google.com/closure/compiler/" rel="noreferrer">Compile</a>- your JavaScript in order to improve your script size</li> <li>Keep cookie size small, since cookies are sent to the server on every request.</li> <li>Consider using <a href="http://en.wikipedia.org/wiki/Link_prefetching" rel="noreferrer">DNS and Link Prefetching</a> when possible.</li> </ul> <p><strong>Global configuration</strong></p> <ul> <li><p>If you use Razor, add the following code in your global.asax.cs, by default, Asp.Net MVC renders with an aspx engine and a razor engine. This only uses the RazorViewEngine. </p> <p><code>ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new RazorViewEngine());</code></p></li> <li><p>Add gzip (HTTP compression) and static cache (images, css, ...) in your web.config <code>&lt;system.webServer&gt; &lt;urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/&gt; &lt;/system.webServer&gt;</code></p></li> <li>Remove unused HTTP Modules</li> <li>Flush your HTML as soon as it is generated (in your web.config) and disable viewstate if you are not using it <code>&lt;pages buffer="true" enableViewState="false"&gt;</code></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload