Gmail image proxy returns 404 for SVG files

Gmail’s new image proxy appears to have difficulties with SVG files

I’m developing a newsletter that includes daily charts as SVG graphics. Everything functioned smoothly until Gmail launched their image proxy system. Now, when I send emails containing SVG images, they fail to render correctly in Gmail.

When I directly access the proxy URL, I’m greeted with a 404 error. Unfortunately, I haven’t come across any official documentation regarding which image formats Gmail’s proxy supports.

Has anyone else experienced this issue? Are SVG files entirely blocked now?

I’m contemplating moving to server-side PNG conversions using headless Chrome, but I’m curious if there are alternative solutions available. The SVG charts are created dynamically each day based on user engagement data, making inline display convenient and avoiding the need for users to click through to our dashboard.

I’m aware that SVG support can differ among email clients, but our primary audience consists of Gmail users. This setup functioned well before the proxy implementation.

Indeed, Gmail’s image proxy blocks SVG content for security reasons, yet they haven’t provided clear documentation on this. I encountered a similar situation last year while creating email templates for financial reports that required vector graphics. My approach was to convert SVGs to base64-encoded PNGs server-side before embedding them directly into emails. This method works flawlessly since the image data is included in the email markup, avoiding any fetching through Gmail’s servers. It does require a bit more processing time, but you can manage that with background jobs or caching. To maintain image quality, render at 2x for retina screens. Although the file sizes increase compared to SVGs, the reliability across all email clients is invaluable for important business communications.

yeah, gmail’s proxy def blocks svgs now. hit the same prob a few months ago with our weekly reports. fixed it by using the canvas api to render charts as pngs before sending - works perfectly and no more 404 errors. bit of a pain but at least it’s consistent across all email clients.

Indeed, Gmail’s image proxy poses significant challenges with SVG files. I encountered a similar situation about six months ago while preparing automated reports for clients, and the proxy consistently returns 404 errors for SVGs. After trying multiple workarounds, I ultimately transitioned to server-side PNG rendering using Puppeteer and headless Chrome, which seems to be the route you are considering. The process turned out to be less complicated than expected, maintaining excellent quality and performance, especially with proper caching. Although PNG files increase email size compared to SVGs, the difference is often negligible for most charts. The benefits include reliable rendering on all Gmail clients, though it is worth noting that you’ll lose any interactive features or animations. For static charts, PNGs are an effective solution.