Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images in Gmail not displaying due to Google Image Cache / Proxy

I have a script to send emails to subscribed users and is currently facing issues with images not displaying properly for users using Gmail.

The images used in the email are publicly available, e.g.:

https://info.xxxx.vn/banner/2018/xxxx-600x300.jpg
https://info.xxxx.vn/banner/2018/xxxx2018v2-600x300.jpg

When the emails are sent to a Gmail user, the image link is changed by Gmail to:

https://ci3.googleusercontent.com/proxy/E6ElwPPH-lH4YdxOtzc8rl9GUpcPA_Kf1E0UFDxNT877wV70lA-KgwQDYQhTXU8ed7U9HJF21PMmGiv0M93jnAKvHszQcFdVAf7ApQta2QgQ=s0-d-e1-ft#https://info.xxxx.vn/banner/2018/xxxx-600x300.jpg
https://ci5.googleusercontent.com/proxy/xK0x7LIhvH9Inax29k0bZKsnC5FerVEhNXjyleL0lU0tbXgb2RBLOYcy_j834lJlOISKgwT6yzJmPWCuHGb9wBkycdEWvwGgWPWJ87NGAJbrosh6gibo9A=s0-d-e1-ft#https://info.xxxx.vn/banner/2018/xxxx2018v2-600x300.jpg

Each of the image links above returns response 404.

Things I've tried:

  1. Use images uploaded to AWS S3 for displaying in the email:
    - It displays perfectly in the email
  2. Disabling any firewall that might block crawlers from accessing the domain:
    - Image is still not displayed.
    - Network team did not notice any external request made to the URL

Is there a way for me to know the exact error which is returned by Google when trying to cache the image? Right now it is always showing the 404 error and there's no way for me to troubleshoot the exact issue.

I would really appreciate any other input as well which would help with troubleshooting the issue I am facing right now.

Thank you very much in advance.

like image 900
user3283396 Avatar asked Apr 11 '18 09:04

user3283396


3 Answers

This can also happen if the image is too large.

Using a 21MB GIF = ❌ response 404 error

Using a 1MB GIF = ✅ works great

like image 90
Airman00 Avatar answered Oct 21 '22 15:10

Airman00


the following solved it for us: whitelisted the following domains in WHM in the "Add IP to Firewall" section:

ci3.googleusercontent.com
ci4.googleusercontent.com 
ci5.googleusercontent.com
ci6.googleusercontent.com
like image 25
MtnPavlas Avatar answered Oct 21 '22 15:10

MtnPavlas


You may refer with this forum. This might be due to a DNS issue on your servers. Also from this blog, it seems that the google proxy servers convert any (spaces) in filenames to + when creating new links. Try to rename all the assets to avoid any use of (spaces).

like image 29
abielita Avatar answered Oct 21 '22 15:10

abielita