{"id":2120,"date":"2015-02-05T08:13:26","date_gmt":"2015-02-05T08:13:26","guid":{"rendered":"http:\/\/blog.jaringanhosting.com\/?p=2120"},"modified":"2015-02-05T08:13:26","modified_gmt":"2015-02-05T08:13:26","slug":"asp-net-mvc-hosting-indonesia-tips-dan-trik-meningkatkan-performa-aplikasi-mvc","status":"publish","type":"post","link":"https:\/\/blog.jaringanhosting.com\/index.php\/asp-net-mvc-hosting-indonesia-tips-dan-trik-meningkatkan-performa-aplikasi-mvc\/","title":{"rendered":"ASP.NET MVC Hosting Indonesia :: Tips dan Trik Meningkatkan Performa Aplikasi MVC"},"content":{"rendered":"<p>Pada kesempatan ini, saya ingin\u00a0berbagi tips dan trik meningkatkan performa\u00a0<span style=\"color: #3f3f3f\">\u00a0ASP.NET MVC.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Pertama : Run in release mode<\/p>\n<p>&#8211; pastikan aplikasi produk\u00a0anda tetap berjalan pada\u00a0release mode di web.config<\/p>\n<pre class=\"lang:default decode:true \">&lt;compilation debug=\"false\"&gt;&lt;\/compilation&gt;<\/pre>\n<p>-atau ubah\u00a0<span style=\"color: #3f3f3f\">machine.config pada server produk anda.<\/span><\/p>\n<pre class=\"lang:default decode:true \">&lt;configuration&gt;\r\n    &lt;system.web&gt;\r\n          &lt;deployment retail=\"true\"&gt;&lt;\/deployment&gt;\r\n    &lt;\/system.web&gt;\r\n&lt;\/configuration&gt;<\/pre>\n<p>Kedua : gunakan view engines<\/p>\n<pre class=\"lang:default decode:true \">protected void Application_Start() \r\n{ \r\n    ViewEngines.Engines.Clear(); \r\n    ViewEngines.Engines.Add(new RazorViewEngine()); \r\n}<\/pre>\n<p>Selanjutnya pakai\u00a0kode\u00a0CachedDataAnnotationsModelMetadataProvider<\/p>\n<pre class=\"lang:default decode:true \">ModelMetadataProviders.Current = new CachedDataAnnotationsModelMetadataProvider();<\/pre>\n<p>-catt: hindari model passing nul<\/p>\n<p>Gunakan OutputCacheAttribute untuk konten yang tidak berubah, gunakan\u00a0OutputCacheAttribute untuk menyimpan tindakan yang tidak dibutuhkan<\/p>\n<pre class=\"lang:default decode:true\">[OutputCache(VaryByParam = \"none\", Duration = 3600)]\r\npublic ActionResult Categories() \r\n{ \r\n    return View(new Categories()); \r\n}<\/pre>\n<p>Selanjutnya, gunakan HTTP Compression<\/p>\n<pre class=\"lang:default decode:true \">&lt;system.webserver&gt; \r\n&lt;urlcompression dodynamiccompression=\"true\" dostaticcompression=\"true\" dynamiccompressionbeforecache=\"true\"&gt;&lt;\/urlcompression&gt;\r\n&lt;\/system.webserver&gt;<\/pre>\n<p>Hilangkan model HTTP yang tidak diinginkan<\/p>\n<pre class=\"lang:default decode:true \">&lt;httpmodules&gt;\r\n      &lt;remove name=\"WindowsAuthentication\"&gt;&lt;\/remove&gt;\r\n      &lt;remove name=\"PassportAuthentication\"&gt;&lt;\/remove&gt;\r\n      &lt;remove name=\"Profile\"&gt;&lt;\/remove&gt;\r\n      &lt;remove name=\"AnonymousIdentification\"&gt;&lt;\/remove&gt;\r\n&lt;\/httpmodules&gt;<\/pre>\n<p>-catt: jika terjadi error setelah\u00a0tindakan remove, lakukan tindakan sebelumnya dengan menambahkan kembali.<\/p>\n<p>Tambahkan HTML anda, segera, setelah berhasil.<\/p>\n<pre class=\"lang:default decode:true \">&lt;pages buffer=\"true\" enableviewstate=\"false\"&gt;&lt;\/pages&gt;<\/pre>\n<p>Kemudian, turn off tracing<\/p>\n<pre class=\"lang:default decode:true \">&lt;configuration&gt;\r\n     &lt;system.web&gt;\r\n          &lt;trace enabled=\"false\"&gt;&lt;\/trace&gt;\r\n     &lt;\/system.web&gt;\r\n&lt;\/configuration&gt;<\/pre>\n<p>Hilangkan HTTP Headers<\/p>\n<pre class=\"lang:default decode:true \">&lt;system.web&gt;\r\n    &lt;httpruntime enableversionheader=\"false\"&gt;&lt;\/httpruntime&gt;\r\n&lt;\/system.web&gt;<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">&lt;httpprotocol&gt;\r\n &lt;customheaders&gt;\r\n  &lt;remove name=\"X-Powered-By\"&gt;&lt;\/remove&gt;\r\n &lt;\/customheaders&gt;\r\n&lt;\/httpprotocol&gt;<\/pre>\n<p>Uninstall URL Rewrite jika tidak dibutuhkan<\/p>\n<p>-tujuannya: untuk melindungi\u00a0CPU yang digunakan saat\u00a0memeriksa variabel server pada\u00a0setiap permintaan.<\/p>\n<pre class=\"lang:default decode:true \">Go to \"Add or Remove Programs\" and find \"Microsoft URL Rewrite Module\" and select uninstall. \r\n<\/pre>\n<p>Terakhir : jangan memasukkan kode yang tidak diperlukan.<\/p>\n<p>Sekarang, Anda dapat menikmati aplikasi<a title=\"ASP.Net MVC\" href=\"http:\/\/jaringanhosting.com\/Indonesia-ASP-NET-MVC-Hosting\">\u00a0asp.net mvc<\/a> dengan performa yang lebih baik dari sebelumnya.<\/p>\n<p>Selamat!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pada kesempatan ini, saya ingin\u00a0berbagi tips dan trik meningkatkan performa\u00a0\u00a0ASP.NET MVC. &nbsp; Pertama : Run in release mode &#8211; pastikan aplikasi produk\u00a0anda tetap berjalan pada\u00a0release mode di web.config &lt;compilation debug=&#8221;false&#8221;&gt;&lt;\/compilation&gt; -atau ubah\u00a0machine.config pada server produk anda. &lt;configuration&gt; &lt;system.web&gt; &lt;deployment retail=&#8221;true&#8221;&gt;&lt;\/deployment&gt;<\/p>\n","protected":false},"author":6135,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/posts\/2120"}],"collection":[{"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/users\/6135"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/comments?post=2120"}],"version-history":[{"count":0,"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/posts\/2120\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/media?parent=2120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/categories?post=2120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jaringanhosting.com\/index.php\/wp-json\/wp\/v2\/tags?post=2120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}