这是一个新的Gmail实验室功能,可让您指定RSS源以抓取随机引号以附加到您的电子邮件签名。我想使用它来根据我传入的参数,当前时间等以编程方式生成签名。(例如,我有一个松树脚本,附加了McCain和Obama获胜的当前概率,取自intrade的API。请参阅下文。)但似乎gmail缓存了您指定的URL的内容。有任何方法可以控制或者任何人知道gmail查看URL的频率吗?

ADDED:这是我用来测试它的程序。此文件位于 http://kibotzer.com/sigs.php 。无缓存标题的想法,取自这里 - http://mapki.com/wiki/Dynamic_XML - 似乎没有帮助。

<?php

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");
?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
<channel>
<title>Dynamic Signatures</title>
<link>http://kibotzer.com</link>
<description>Blah blah</description>
<language>en-us</language>
<pubDate>26 Sep 2008 02:15:01 -0000</pubDate>
<webMaster>dreeves@kibotzer.com</webMaster>
<managingEditor>dreeves@kibotzer.com (Daniel Reeves)</managingEditor>
<lastBuildDate>26 Sep 2008 02:15:01 -0000</lastBuildDate>

<image>
<title>Kibotzer Logo</title>
<url>http://kibotzer.com/logos/kibo-logo-1.gif</url>
<link>http://kibotzer.com/</link>
<width>120</width>
<height>60</height>
<description>Kibotzer</description>
</image>

<item>
<title>
Dynamic Signature 1 (<?php echo gmdate("H:i:s"); ?>) 
</title>
<link>http://kibotzer.com</link>
<description>This is the description for Signature 1 (<?php echo gmdate("H:i:s"); ?>) </description>
</item>

<item>
<title>
Dynamic Signature 2 (<?php echo gmdate("H:i:s"); ?>) 
</title>
<link>http://kibotzer.com</link>
<description>This is the description for Signature 2 (<?php echo gmdate("H:i:s"); ?>) </description>
</item>

</channel>
</rss>
--
http://ai.eecs.umich.edu/people/dreeves  - -  search://"Daniel Reeves"

Latest probabilities from intrade...
  42.1%  McCain becomes president (last trade 18:07 FRI)
  57.0%  Obama becomes president (last trade 18:34 FRI)
  17.6%  US recession in 2008 (last trade 16:24 FRI)
  16.1%  Overt air strike against Iran in '08 (last trade 17:39 FRI)
有帮助吗?

解决方案

您可以在客户端执行某些操作,请查看此 greasemonkey脚本随机添加签名。由于它在您的控制之下,而不是谷歌的,您可以控制它是否缓存。

其他提示

尝试设置缓存控制:无缓存 Pragma:no-cache HTTP头。如果谷歌的签名代码尊重其中任何一个标题,那么你会很幸运。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top