I have a very strange problem with a website: for some unknown reason it loads very slow some images.
For example: There are 16 images to load ( each image is .jpg, around 10k ) and every time 3-4 of this images are (random) loaded in 4-5 seconds and all others in a good time 600ms.
Is insane that to load 30-40k of 3-4 images the Waterfall is >= 15s by considering also that the domain is SSL, have CloudFlare active and is running on a good dedicated server with cPanel.
Are several days that I’m trying to find a solution and I have already: try to disable cloudflare, try to load the images from a subdomain, try to compress the images, try several .htaccess settings.
Regarding lazyload, in this case it can’t help me because all 16 images are in the browser view ( like the youtube homepage )
GTMetrix report ID: cA72pYL1
Any suggestion is good, thank you a lot.
— Additional informations and tests —
- Using cPanel – Apache
- To load an image of 10k now the average is around 0.7s
- Any error log ( web/server side )
- The rest of website/server load without problems
2
Answers
Have you considered using base 64 images ?
Go to : https://www.base64-image.de/
Upload your image and it will give you the
base64
replace the
src
of your images like :with
here’s an explination of what that is : Base64 encoding images
When to Base64 Encode Images (and When Not To)
How does the rest of your site perform? You’ve tried several things from the image perspective, what about looking at the site perspective?
Check your logs (web and system) – any errors?
Are other aspects of your site performing as expected? Page loads, form submission…If not then the images may not be the root issue.
Did you make any changes recently? Have these images always loaded this way, or was there a time when they loaded consistently?
Is it always the same images that load more slowly? If so, then investigate what is different with those files.
Or, is it always the same time span (from start of loading images to moment of slow down) when the loading slows down? If so, investigate your caching, buffering, network & bandwidth settings.
I don’t know if this is possible, but can you try loading these images on a different web server? (Trying to eliminate possibilities here.)