1

I have an application written in asp.net c# and hosted on IIS6. There are an 'Image' folder with 3-subfolders. These folders contained images of type 'jpg','gif','png' etc. Images are very huge in size and in numbers. On the application every page has some images needs to open/show, due to the size of images my application get slower and slower.

I know there are some techniques to Cache image folders at client machine or some other methods. I have no access on IIS. So, I need some httphandler or httpmodules which provide something like Image-caching.

I tried this : codeproject.com/KB/aspnet/CachingImagesInASPNET.aspx The problem is I have to add an extra extension '.ashx' to every image link. There is no problem with images are loading dynamically but it has trouble with images need to embose a manual link. Also, this is working fine upto around 1000s images.

All suggestions/solutions will be appreciated.

Gaurav Arora
  • 2,243
  • 6
  • 40
  • 57
  • Thanks everyone - my problem is solved now with this : codeproject.com/KB/aspnet/CachingImagesInASPNET.aspx. The actually working application is : http://singhshashtar.com/ – Gaurav Arora Dec 06 '10 at 11:37
  • Cool. Hope this works out for you. How about a few upvotes for @Oded, @5arx for stopping by to help ;-) – immutabl Dec 06 '10 at 11:40
  • 1
    @5arx - Cool man, I already did it. Thanks once again to both of you. – Gaurav Arora Dec 06 '10 at 11:44

2 Answers2

1

Caching on the client happens automatically.

Are you talking about keeping file in server memory (IIS file cache)?

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • @Oded - you are right but it took huge time to uplaod images everytime.I am looking something like this : http://www.codeproject.com/KB/aspnet/CachingImagesInASPNET.aspx – Gaurav Arora Dec 06 '10 at 10:15
  • @Oded - Thanks, I tried the same but after around 1000s images it get me back into the same situation where I am? – Gaurav Arora Dec 06 '10 at 10:25
  • @Rick - Are you displaying 1000 images on one page? Is that where the slowdown is? – Oded Dec 06 '10 at 10:27
  • @Oded- Actually this is an example, images are more than 1000s, needs to show on a single page. – Gaurav Arora Dec 06 '10 at 10:42
  • @Rick - caching won't help you. Is the slowdown happening on the browser? If so, the problem is probably with displaying so many images. Are you putting them in tables? – Oded Dec 06 '10 at 10:44
  • @Oded - Images are displaying in DataGrid. Actually we are showing 10-10 images on a page through Datagrid and all images are loaded at once while user navigate the application. – Gaurav Arora Dec 06 '10 at 11:01
  • @Rick - Do you need the DataGrid - its pretty heavy for just displaying things ...? – immutabl Dec 06 '10 at 11:10
  • @Rick - I am still not clear on _where_ you are seeing the slowdown. Server side? DB? Browser? All of them? – Oded Dec 06 '10 at 11:16
  • @Oded-Whenever page [contained images] is loading it slow down the site. Images are in Folders so no interference of DB is here – Gaurav Arora Dec 06 '10 at 11:25
  • @Rick - How are you putting the images on the datagrid? – Oded Dec 06 '10 at 11:27
1

I would look at some kind of buffering mechanism using AJaX. No one is going to want to look at 1000+ images at the same time.

Maybe you could take a look at the latest version of Google's Image Search for 'inspiration' ;-)

immutabl
  • 6,857
  • 13
  • 45
  • 76
  • We are using UpdateProgress of Ajax, but the same issue its taking too lengthy time to uplaod images. We are showing 10-10 images in a Datagrid and there are around 100 pages on Grid for 1000s images – Gaurav Arora Dec 06 '10 at 11:02
  • @Rick - do you need to show the full-size imgs as previews? Maybe you could write a custom handler to serve images and resize them on the fly? – immutabl Dec 06 '10 at 11:11
  • Yes, I need to do it as you said. I added some more description into my query please look into it, – Gaurav Arora Dec 06 '10 at 11:25