动态图像的电子邮件,如倒计时时钟(根据gmail图像缓存) [英] Dynamic Images for email such as countdown clocks (in light of gmail image caching)

查看:644
本文介绍了动态图像的电子邮件,如倒计时时钟(根据gmail图像缓存)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力做什么:电子邮件正文中的动态倒数时钟

What I am trying to do: A dynamic countdown clock in the body of an email

是什么导致我的痛苦:Google决定为gmail客户端

What is causing me pain: Google's decision to cache images for users of the gmail client

去年11月,我使用这种技术为我的公司实施了一个电子邮件倒计时时钟:

I implemented an email countdown clock for my company last November using this technique:

倒计时计时器图像电子邮件中的GIF

尽管如此,十二月份,当Google决定使用Gmail客户端缓存所有图片时,谷歌抛出了一个主要的猴子扳手。

Worked like a charm, however in December, a major monkey wrench was thrown by Google when they decided to cache all images for people using Gmail clients.

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

所以问题会影响gmail客户端打开电子邮件的所有人第二次他们会看到缓存的图像。对于像倒计时钟这样的事情,这会造成很大的伤害。

So the problem affects all people on gmail clients that open an email a second time. They will see a cached image. For something like a countdown clock, this would cause a lot of harm.

诚然,这有点是一个盲目的呼救,但是有人知道如何做一个电子邮件倒数时钟不受谷歌图像缓存的影响?

Admittedly this is somewhat of a blind distress call, but has anyone figured out how to do a email countdown clock that is unaffected by google's image caching?

推荐答案

我也有同样的问题。因此,使用以下标题,我禁用图像缓存,并且在Gmail中也可以使用(因此,Gmail Image Proxy会遵循缓存标头):

I had the same problem. So with the following headers, I disabled image caching and it works in Gmail too (therefore Gmail Image Proxy respects the 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");

对这个图书馆备注的信用

这篇关于动态图像的电子邮件,如倒计时时钟(根据gmail图像缓存)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆