Dynamic images for email, such as reverse hours (in light of image caching in Gmail)

What I'm trying to do: dynamic reverse hours in the body of the letter

What hurts me: Google's decision to cache images for gmail client users

Last November, I applied an email countdown clock to my company using this technique:

Email GIF Countdown

It worked like a charm, but in December, the main Google neutralized Google when they decided to cache all the images for people using Gmail clients.

http://kickdynamic.com/update-on-the-gmail-image-change/

Thus, the problem affects all users of gmail clients who open email for the second time. They will see the cached image. For something like a countdown clock, it does a lot of harm.

Admittedly, this is somewhat of a blind disaster call, but did anyone understand how to make an email countdown clock that is not affected by Google Image Caching?

+4
source share
1 answer

I had the same problem. Therefore, with the following headers, I turned off image caching, and it also works in Gmail (therefore, Gmail Image Proxy respects cache headers):

header('Content-Type: image/jpeg');
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

Credits to this library note .

+4

Source: https://habr.com/ru/post/1527122/


All Articles