.Net Web Developer Should Know?

1. Remove the HTTP Headers

By removing the header “X-Powered-By” you make a save around 29bytes for each requests, another reason as well you doesn’t want exposing stack trace.

Server: Microsoft-IIS/8.5

<httpRuntime targetFramework="4.5.1" enableVersionHeader="false" />

        <clear />
        <remove name="X-Powered-By" />


//In Global put this
MvcHandler.DisableMvcResponseHeader = true;

2. Production
When you put the source code into the production you need to turn off the debug=”false” in the webconfig.
This will help to compilation of ASP become faster, code execute more faster and reduce more memory in used.

3. Enable Caching
Caching is one of the most important things, most of the times you doesn’t want anyone to keep download the image, css, js from your machine.

    <urlCompression doDynamicCompression="true" doStaticCompression="true" />
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> <!-- Make it 7 Days -->
    <caching enabled="true" enableKernelCache="true">
        <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
        <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client"/>
        <!-- You can Add any static file in here -->

4. Bundling & Minification
In the past most of Web Developer try to use any method to minify their JS & CSS, by remove all the space using JSCompress or CSSCompress site. What they forget .Net provide the build-in features Under App_Start/BundleConfig.cs

        public static void RegisterBundles(BundleCollection bundles)
            bundles.Add(new ScriptBundle("~/bundles/jquery",

             bundles.Add(new StyleBundle("~/Content/css").Include(

After register in the Bundling, all you need to do in the production server just need to turn off in the web.config

<compilation debug="false" targetFramework="4.5.1" />

After you done, when you trace the HTTP Stack it’s will show jquery been minify with less work done.


One thought on “.Net Web Developer Should Know?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s