The problem
My website fails to load random images at random times. Intermittent failure to load image with the following error in console:
"GET example.com/image.jpg net::ERR_CONTENT_LENGTH_MISMATCH"
Image either doesn't load at all and gives the broken image icon with alt tag, or it loads halfway and the rest is corrupted (e.g. colors all screwed up or half the image will be greyed out).
Setup
Litespeed server, PHP/mySQL website, with HTML, CSS, Javascript, and JQuery.
Important Notes
- Problem occurs on all major web browsers - intermittently and with various images.
- I am forcing UTF-8 encoding and HTTPS on all pages via htaccess.
- Hosting provider states that all permissions are set correctly.
- In my access log, when an image fails to load, it gives a '200 OK' response for the image and lists the bytes transferred as '0' (zero).
- It is almost always images that fail to load but maybe 5% of the time it will be a CSS file or Javascript file.
- Problem occurred immediately after moving servers from Apache to Litespeed and has been persistent over several weeks.
- Gzip and caching enabled.