We're having a debate over the pros and cons of using file_exists() to check whether an image exists or not, prior to deciding whether to show it or a holding image. Generally we agree that it's a good thing as it prevents image placeholders being displayed by accident, but on some pages that have a lot of images, especially ones with a lot of traffic, it hammers the server somewhat and introduces significant processing delays.
Can you supply a link to your site?
It's still a lot slower if the cached images are found than with file_exists() disabled
Have you tried using the file_exists() and not displaying the images. Does nt loading the images "still hammer the server" and slow the page rendering?
Have you tried moving the images to a sub-domain? There are many helpful articles explaining ? I like this one:
- Host images on a subdomain
Did you ever have a kiddie pool? Do you remember how long it took to fill it up with your one hose? What if you could’ve used your neighbor’s hose at the same time and filled up the pool twice as fast?
Most web browsers allow only two to four “hoses” or connections from a single domain (like TheHobbyBlogger.com) to download content. So if you have a lot of images on your blog, your readers might have to wait for one or more images to load before they can begin reading your content.
By creating a subdomain such as img.yourdomain.com to host your images, you effectively add a second set of hoses to fill your readers web browsers. This allows your blog content to load simultaneously with your images and speed up your page loads.