I'm using a remote server for hosting images to a website, and was looking into caching on the website's server to minimize transactions between the two. I did find something interesting, in that it seems that .Net is automatically caching images on the site server.
I tested this out by adding two images to the image server (image1.jpeg, image2.jpeg), setting a field in the database to link to image1.jpeg, bringing up the website and seeing that image1.jpeg is indeed displaying. Now, I renamed image2.jpeg to image1.jpeg (yes, I renamed image1.jpeg something else), and hard refreshed the page. Still shows the original image. I closed the browser, opened it again and went to the site. Same image. So, reading that the cache usually clears when the file can't be found, I delete both image1 and image2. Hard Refresh shows the red X as it should. I load image2.jpeg as named image1.jpeg to the image server, and hard refresh. Still shows the original image.
So, from this test I deduced that the site server initially requests the image from the image server, copies it locally, and when the client requests it, it gives them the local copy (which, according to caching logic, makes perfect sense). However, when you change the original file, the local copy does not get updated with the change. My question is one: is it possible to have the caching look for a file change and update it's local cache with the new file? And two: where would I set this configuration?
I tested this out by adding two images to the image server (image1.jpeg, image2.jpeg), setting a field in the database to link to image1.jpeg, bringing up the website and seeing that image1.jpeg is indeed displaying. Now, I renamed image2.jpeg to image1.jpeg (yes, I renamed image1.jpeg something else), and hard refreshed the page. Still shows the original image. I closed the browser, opened it again and went to the site. Same image. So, reading that the cache usually clears when the file can't be found, I delete both image1 and image2. Hard Refresh shows the red X as it should. I load image2.jpeg as named image1.jpeg to the image server, and hard refresh. Still shows the original image.
So, from this test I deduced that the site server initially requests the image from the image server, copies it locally, and when the client requests it, it gives them the local copy (which, according to caching logic, makes perfect sense). However, when you change the original file, the local copy does not get updated with the change. My question is one: is it possible to have the caching look for a file change and update it's local cache with the new file? And two: where would I set this configuration?