I'm creating a .internet web application in c#/.internet. For images on my small site I'm using relative pathways. However to help with performance of my website I'm searching introducing cookieless domain names for images.

In many situations I'm able to just add the domain towards the images.

However in certain situations I cant and have to do it at run time. And So I am searching at presenting some code to solve the web addresses. I've got a couple options to do this.

  1. Method in base page to loop through all of the controls, add append the domain to any or all controls that inherit for System.Web.Ui.Image and append domain otherwise present.

  2. Or do similar inside a http module. (Is possible)

Will doing the above mentioned decelerate my website rendering? I dont want this to become not a good idea!

Either of the aforementioned approaches should work suitable for .internet controls.

But any ideas the way i might append the domain to html img tag and/or any images inside my stylesheets? I most likely can just set the domain names from the img tag in code, although not certain of the stylesheets.

You can look at using Response.Filter too.