1

I have a PHP script that uploads image files to a directory on my Windows 2019 server. It saves the images in a directory set up as a virtual directory in IIS for my website/service. Specifically, it points to a drive that houses over 30 million images, broken down into directories and subdirectories, so they don't get too overloaded.

Every time I upload a new image via this PHP call, the file appears instantly in the directory on Windows, and sometimes when I call the URL to access the new image (example: mywebsite.com/1.jpg), the images appears instantly in a browser. But sometimes the browser gives me back a 404 error, and when I retry loading the image (on many different browsers) it can take anywhere from 5-30 seconds to get it to finally appear. Note that these are new image URL's, not overwriting or caching old images.

When I remote into my server and then browse in Explorer to exactly where the image is and open it, or even just click on it, sometimes that is enough for IIS to all of the sudden make the URL work and not do a 404 anymore.

Does anyone know why this could be happening? Is there some type of indexing that IIS does only periodically to directories? Is there a refresh rate, or some way to force IIS to get the file? I've looked at everything from Application Pools to File Permissions and anything else I can think of.

I'm really at a loss here.

Ethan Allen
  • 163
  • 1
  • 9

0 Answers0