1

A few days ago, images from a website I maintain stopped being displayed in Gmail. The Google's Image Cache Proxy returns 404 on every image. I can confirm that they are accessible on the server itself and the newsletter displays fine outside gmail.com, even in Gmail's own mobile app (it apparently does not use Google Image Proxy). I can even confirm, that Google's bot fetches these images regularly from the server itself with the server responding 200 status and sending the image. The images in question are png and jpg, no svgs (which appear to have had problems in the past according to my research)

Is there a known remedy for this and why is Google this evil? Is there a special header that should be set for this? Like Cache-Control header that is required by their Image Proxy specifically?

1

The PHP application was serving a corrupted image when incorrectly handling Accept-Language header which Google Bot sends. Same incorrect handling happened when sending no extra headers to the page.

On the page where was supposed to be an image was a notice saying:

Undefined index: HTTP_ACCEPT_LANGUAGE in /var/www/myweb.com/public/constants.php on line 3

The notice reports a 200 HTTP status, which is why I was not able to catch it right away. Google Bot however fetched it as an invalid image and in turn reported a 404 error.

I solved it by installing php-intl package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.