Friday, October 25, 2013

Website Speed Optimization for Online Performance - Web.config

NON WWW to WWW Working 

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Redirect to WWW" stopProcessing="true">
          <match url=".*" />
          <
conditions>
            <add input="{HTTP_HOST}" pattern="^your.domain.name$" />
          </
conditions>
          <action type="Redirect" url="http://www.your.domain.name/{R:0}" redirectType="Permanent" />
        </
rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

GZIP Working

<system.webServer>
  <httpCompression directory="%SystemDrive%\inetpub\
temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
    <dynamicTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </dynamicTypes>
    <staticTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </staticTypes>
  </httpCompression>
  <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>

Expires header Working

<staticContent>
 <clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>

E-Tag Working

301 page Redirect Working

<configuration>
  <location path="services.htm">
    <system.webServer>
      <httpRedirect enabled="true" destination="http://domain.com/services" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
  <location path="products.htm">
    <system.webServer>
      <httpRedirect enabled="true" destination="http://domain.com/products" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
</configuration>


This redirection for all the pages. Paste this above </configuration>

<location path="pgdm_gen_manager.html">
    <system.webServer>
      <httpRedirect enabled="true" destination="http://domain.com/products" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>

Reference

NON WWW to WWW  - http://www.studiocoast.com.au/knowledgebase/335/iis7/redirect-non-www-to-www.aspx

GZIP - http://am-blog.no-ip.org/BlogEngine/post/2010/11/23/Enable-Gzip-compression-in-ASPNET-using-webconfig-configuration.aspx

Expires header - 
http://madskristensen.net/post/Add-expires-header-for-images.aspx
301 page Redirect -
http://knowledge.freshpromo.ca/seo-tools/301-redirect.php
Render blocking CSS
Move the Blocking CSS below the </html>
htm<l/> <link href="css/style.css" rel="stylesheet" type="text/css">

1 comment: