Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Skin Images are not called by httpHandlers or httpModules with ~reference

Reply
Thread Tools

Skin Images are not called by httpHandlers or httpModules with ~reference

 
 
Nemisis
Guest
Posts: n/a
 
      08-08-2008
I would like to cache images for my web pages on the client but not
the page content as most of it is dynamically created. I need this
to
work mainly because our Pda website, seems to always download the
images, even if the images are the same, but on a different page?? I
have tried setting the cache settings via IIS, but images only cache
when the querystring is the same (since we use encrypted Id values),
this is hardly the case, and the image is re-downloaded. So i have
tried the following....


1. Write a httpHandler that intercepts calls for gif.ashx, png.ashx
and jpg.ashx images
2. The httpHandler then checks to see if the image is stored in
Response.Cache.
3. If not, then it retrieves the image and stores it in
Response.Cache
4. I then write the following headers, to make sure the image is
stored on the clients machine.


' set cacheability
context.Response.Cache.SetExpires(Date.Now.AddDays (1))
context.Response.Cache.VaryByParams("data") = False
context.Response.Cache.SetValidUntilExpires(False)


context.Response.Cache.SetCacheability(HttpCacheab ility.ServerAndPrivate)


5. I then write the image to the page


In order to get this too work i had to change all my image references
in my css skin files to include the additional .ashx extension, and
include the httpHandler in my web.config file


This all works fine, for ImageButtons, hyperlinks etc, until i come
across a skin file that sets the ImageUrl using ~


Does anyone know why this is??


I also did the same using a HttpModule, but i get the same results.
Any help would be much appricated.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly for HttpModules and HttpHandlers Ray ASP .Net 0 11-04-2008 11:47 AM
HttpModules not executing on first post of page tshad ASP .Net 0 03-03-2006 05:10 PM
"Chicken skin" effect when scanning b/w images jersie0 Digital Photography 9 02-10-2005 02:46 AM
Static variables in httphandlers/httpmodules =?Utf-8?B?U3RlZW4gVMO4dHRydXA=?= ASP .Net 1 11-19-2004 08:47 AM
HttpHandlers and HTTPModules matt ASP .Net 5 04-20-2004 07:35 AM



Advertisments