Pages

Wednesday, August 19, 2009

Enabling Gzip compression in IIS 6.0 for ASP.NET websites

 

Server performance tip , using gzip compression can decrease the number of bytes sent by your server. This gives the perception of faster pages and also cuts down on bandwidth usage. Depending on the data sent, how well it can be compressed, and whether the client browsers support it (IIS will only send gzip compressed content to clients that support gzip compression, such as Internet Explorer 6.0 and Firefox), your server can serve more requests per second. In fact, just about any time you can decrease the amount of data returned, you will increase requests per second.

 

Step 1:

 

Expand IIS Manager. Right click on Websites. Click Properties. Click the Service tab. Check the boxes to enable compression,You can give where the temp files can get stored there and the size that is allowed

1

 

Step2:

Install IIS 6.0 Resource Kit Tools download from MSDN .

 

Step3:

Open the IIS Metabase Explorer. It is part of the resource kit you just installed. Expand LM>W3SVC>Filters>Compression. You will need to edit both gzip and deflate. Find the item with the name HcScriptFileExtensions. Add the values aspx, axd, asmx, js  and css . Repeat process for gzip and deflate. Find HcDynamicCompressionLevel and set it to something higher than 0.

Never try to gzip audio,Video and jpg files which are already compressed, For jpg and other images use smush it tool

2

Tuesday, August 18, 2009

Configuring CrusControl

 

Hi Guys,

Most of the build process in general is automated , generally people use so many tool, one among them is CC(CrusControl) , I used this CrusControl to make my build job easy, its really good. i know that all the functionalities here i mentioned we can achieve through normal C# code itself. But this like they have done we just need to configure :).

K let start Following functionalities

1. Triggering Build at certain time , Scheduling build

2. Getting latest from Vss , To fresh folder and applying Lable once the latest is done.{if the Vss get latest is not working make sure the CrusControl service is running with windows account goto Logon option and change it }

3.Build the solution using devenv.exe

4. Executing EXEs using Crouscontrol

5.Generating FxCop Report

6.Send the result to team

 

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- START - Block for MFW V2 - added by Ashwani-->
  <project name="Messaging framework v2">
    <workingDirectory>D:\MFWv2\</workingDirectory>
    <webURL>http://172.16.136.15/ccnet/server/local/project/Messaging+framework+v2/ViewProjectReport.aspx</webURL>
    <triggers>
      <filterTrigger startTime="13:00" endTime="06:00">
        <trigger type="filterTrigger" startTime="0:00" endTime="23:59:59">
          <trigger type="intervalTrigger" name="continuous" seconds="900" buildCondition="ForceBuild"/>
        <!--  <weekDays>
            <weekDay>Saturday</weekDay>
            <weekDay>Sunday</weekDay>
          </weekDays>-->
        </trigger>
      </filterTrigger>
      <scheduleTrigger time="16:00" buildCondition="ForceBuild" name="Scheduled">
      </scheduleTrigger>
      <scheduleTrigger time="13:00" buildCondition="ForceBuild" name="Scheduled">
      </scheduleTrigger>
    </triggers>

    <modificationDelaySeconds>100</modificationDelaySeconds>

     <sourcecontrol type="multi">
        <sourceControls>
        <vss>
             <project>"$/AceRoot/Development/ACE Messaging Framework V2/ReleaseToQA"</project>
            <username>venkatard</username>
            <password>password1</password>
            <executable>C:\Program Files (x86)\Microsoft Visual SourceSafe\SS.EXE</executable>
            <ssdir>\\172.16.131.231\ACE$\</ssdir>
            <applyLabel>True</applyLabel>
            <autoGetSource>True</autoGetSource>
            <workingDirectory>C:\MFWDailyBuilds\VSSBuildVersion</workingDirectory>
            <timeout units="minutes">40</timeout>
            <cleanCopy>True</cleanCopy>
        </vss>
        <vss>
            <project>"$/AceRoot/Development/ACE Messaging Framework V2/Source Projects V2"</project>
            <username>venkatard</username>
            <password>password1</password>
            <executable>C:\Program Files (x86)\Microsoft Visual SourceSafe\SS.EXE</executable>
            <ssdir>\\172.16.131.231\ACE$\</ssdir>
            <applyLabel>True</applyLabel>
            <autoGetSource>True</autoGetSource>
            <workingDirectory>D:\MFWv2\Source Projects V2\</workingDirectory>
            <timeout units="minutes">40</timeout>
            <cleanCopy>True</cleanCopy>
        </vss>   
        </sourceControls>
    </sourcecontrol>
    <tasks>

      <!-- Start Build Source Code Projects -->
      <!-- Listener solution Build-->
     <devenv>
        <solutionfile>"D:\MFWv2\Source Projects V2\ACE MFW V2.sln"</solutionfile>
        <configuration>Release</configuration>
        <buildtype>ReBuild</buildtype>
        <executable>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</executable>
        <buildTimeoutSeconds>2400</buildTimeoutSeconds>
      </devenv>
      <!-- Website solution Build-->
       <devenv>
        <solutionfile>"D:\MFWv2\Source Projects V2\MFWSetups\MFWSetups.sln"</solutionfile>
        <configuration>Release</configuration>
        <buildtype>ReBuild</buildtype>
        <executable>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</executable>
        <buildTimeoutSeconds>2400</buildTimeoutSeconds>
      </devenv>
      <!-- Start execution of FxCop -->
      <exec>
        <executable>C:\Program Files (x86)\Microsoft FxCop 1.36\FxCopCmd.exe</executable>
        <baseDirectory>C:\Program Files (x86)\Microsoft FxCop 1.36\</baseDirectory>
        <buildArgs>/p:"D:\MFWv2\Source Projects V2\FxCOP\MFW V2.FxCop"  /out:"D:\MFWv2\Source Projects V2\FxCop-results.xml" /gac</buildArgs>
        <buildTimeoutSeconds>300</buildTimeoutSeconds>
      </exec>
      <!-- Complete execution of FxCop -->

    </tasks>

    <publishers>
      <merge>
        <files>
          <!-- Start FxCOP result -->
          <file>D:\MFWv2\Source Projects V2\FxCop-results.xml</file>
          <!-- Complete FxCOP result -->
          <!-- Start MStest result-->
         <!-- <file>D:\TestProjects.trx</file>-->
          <!-- End MStest result-->
        </files>
      </merge>

      <email from='venkatard@gmail.com' mailhost='smtp.gamil.com' includeDetails='true'>
        <users>
          <user name='MFW' group='ACE' address='venkatard@gmail.com'/>
          <!--Product_MFW@gmail.com-->
        </users>
        <groups>
          <group name='XXXX' notification='always'/>
        </groups>
      </email>
      <xmllogger />
    </publishers>
  </project>

<!-- END - Block for MFW V2 - added by Venky-->
</cruisecontrol>

Monday, August 17, 2009

Get the Screen size using JavaScript

 

<html
xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function showScreenData() {
            document.getElementById("lblScreenDetails").innerText =
           "Total Height: " + screen.height
           +" Total Width: " + screen.width
           +" Available Height: " + screen.availHeight
           +" Available Width: " + screen.availWidth
           +" Available Pixel Depth : " + screen.pixelDepth
           +" Available Color Depth : " + screen.colorDepth
           +" Buffer Depth : " + screen.bufferDepth;
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    <asp:Button ID="btnScreenData" runat="server" Text="Get Screen Details" OnClientClick="return showScreenData()" />
    <br />
    <asp:Label ID="lblScreenDetails" runat="server" Text="Label"></asp:Label>
    </form>
</body>
</html>

-Venky