Grant Davis
5/4/2006 10:46:00 PM
I have an aspx page that is used in src tags on other pages to serve
images. The image that is served is determined by a query string:
src=mypage.aspx?imageId=12344
Each image has a unique id, so a unique image is defined by the entire
URL, including the query parameters.
The aspx page locates the file (wherever it may be) and puts it into
the output stream via Response.WriteFile().
Everything works great.
However, I would like to enable browser caching of these images and
only serve the image back to the browser if the file has changed (which
they sometimes do).
Because I cannot predict when the images will change, I would like the
server to respond with a "304 - Not Modified" if the file has not been
modified, and to serve it to the browser otherwise. I've read
everything I can find on the net about this scenario, but none of the
explainations are very clear and those suggesttions that I have tried
don't seem to work.
Could someone provide a simple, direct answer outlining how this can be
accomplished in asp.net 1.1?
Thanks in advance for your help.
Grant