我使用PHP语言创建了一个动态生成的iCalendar提要,坚持使用RFC5545。它在大多数情况下都运行得很好,除了iCal (即most的内置日历程序)似乎拒绝反映它之前已经下载的事件的更新。我认为这是由于缓存造成的。有没有办法告诉iCal不要缓存我的提要?
编辑:哦,对了,我忘了说我已经尝试过让每个VEVENT在每次调用提要时都有一个不同的UID (我的UID格式是" ID ",其中是以RFC5545的日期时间格式表示的当前时间,是我的数据库中事件的惟一ID)。我还尝试了处理标题中的Content-type;无论我将其设置为text/plain还是text/日历,都会出现这个问题
发布于 2012-02-01 06:56:25
我从来没有处理过iCal,但是尝试设置头来强制重新验证。
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>发布于 2012-02-01 06:57:36
你有没有试过添加"no-cache“头?
<?php
header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); //date in the past
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); //tell it we just updated
header( 'Cache-Control: no-store, no-cache, must-revalidate' ); //force revaidation
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
?>https://stackoverflow.com/questions/9088126
复制相似问题