views:

214

answers:

1

Hi.

I have a HttpHandler for resizing images, round corners, reflection etc etc. This i working OK. The problem i have is, that some data is stored in cookies, and the cookies are send to images, when they are shown. Is there any way to disable this globally (cookie-free requests) in web.config, or even in the HttpHandler itself?

Example page: http://test.roob.dk/dk/product/ray-ban-rb3359-polarized-16/

Thanks in advance CP // Denmark

+1  A: 

The best way is to serve the images from another subdomain, for instance static.yourdomain.dk. This is because the browser will send the cookies with any request to the domain, that have issued them - so they will be included for any request to your images handler, when they really are not needed. Of course, you should also ensure that your image handler itself does not set any cookies.

Some even have sevaral static domains, like static0, 1, 2, 3. This is because many browsers by default will only issue one or two requests to the same domain at the same time, and wait for them to complete, before starting the next request. By having multiple domains, you allow the browser to retrieve more ressources in parallel. Here is an article about just that: http://yuiblog.com/blog/2007/04/11/performance-research-part-4/

driis
Hi Driis.Thanks for the reply. Yeah, i have been thinking about this solution, but this will require two separate domain/website. This wold be the perfect solution to place static content on a separate domain/website. but not the cheapest solution for customers, if they have to pay for two hosted sites.Wouldnt it be possible, to place a web.config in /assets/ folder (all static content is places here), and disable cookies by config.
You do not need 2 hosted sites. Just point 2 or more domain names to the same host. (You can't tell the browser to not send the cookies for paths below the domain that issued them).
driis