Click here to Skip to main content
13,196,730 members (71,653 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How do i cache all images in my website to client machine and how do i cross check performance of my web site? i have search a lot and i have created handler also but i am not able to find out whether it is write or wrong. following are code chunk which i have done in my application...

i have used "SoftwareArchitects.dll" file, which i download from code project.

The things i added in Config file..
    <!-- software architects - CachingHandler -->
    <sectionGroup name="SoftwareArchitects">
      <section name="Caching" requirePermission="false" type="SoftwareArchitects.Web.Configuration.CachingSection, SoftwareArchitects.Web.CachingHandler"/>
    <compilation debug="true" targetFramework="4.0" />
    <trace enabled="true" pageOutput="false" requestLimit="50" mostRecent="true"/>
      <!-- software architects - CachingHandler -->
      <add verb="*" path="*.gif.ashx" type="SoftwareArchitects.Web.CachingHandler, SoftwareArchitects.Web.CachingHandler"/>
      <add verb="*" path="*.jpg.ashx" type="SoftwareArchitects.Web.CachingHandler, SoftwareArchitects.Web.CachingHandler"/>
      <add verb="*" path="*.png.ashx" type="SoftwareArchitects.Web.CachingHandler, SoftwareArchitects.Web.CachingHandler"/>
    <Caching CachingTimeSpan="1">
        <add Extension="gif" ContentType="image\gif"/>
        <add Extension="jpg" ContentType="image\jpeg"/>
        <add Extension="png" ContentType="image\png"/>

Following is my default.aspx file

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ImageCaching._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        Image Caching Sample
        <img src="Images/1.png.ashx" />
        <asp:Button ID="btn" runat="server" />

Everything is working fine but i can not calculate the speed defference. i used trace.axd also but every time the trace is same....
Posted 31-Jan-13 18:18pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this link
Caching Images in ASP.NET[^]

Hope this helps
vishal.shimpi 1-Feb-13 1:02am
I tried with this same link that u suggested, but still the problem is that at first load my trace is of 50 line when i click on any button or refresh page after that again the trace is 50..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171019.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100