我可以阻止 iCal 缓存 PHP 生成的 iCalendar 源吗?
我用 PHP 制作了一个动态生成的 iCalendar feed,遵循 RFC 5545。它在大多数情况下工作得很好,除了 iCal(即 Mac OS X 的内置日历程序)似乎拒绝反映对其先前已下载的事件的更新。我假设这是由于缓存造成的。有没有办法告诉 iCal 不要缓存我的 Feed?
编辑:哦,是的,我忘了提及,我已经尝试让每个 VEVENT 在每次调用 feed 时都有不同的 UID(我的 UID 格式是“id”,其中是 RFC 5545 的日期时间格式中的当前时间,是我的数据库中事件的唯一 ID)。我还尝试过使用标题中的内容类型;无论我将其设置为文本/纯文本还是文本/日历,都会出现此问题
I made a dynamically generated iCalendar feed with PHP, sticking to RFC 5545. It's working just fine for the most part, except iCal (i.e. Mac OS X's built-in calendar program) seems to refuse to reflect updates to events it had previously already downloaded. I'm assuming this is due to caching. Is there a way I can tell iCal not to cache my feed?
EDIT: Oh yeah, I forgot to mention that I've already tried making each VEVENT have a different UID each time the feed is called (my UID format is "id", where is the current time in RFC 5545's DATE-TIME format, and is the unique ID of the event in my database). I've also tried playing with the Content-type in the header; this problem happens whether I set it to text/plain or text/calendar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我从未处理过 iCal,但尝试设置标头以强制重新验证。
I've never dealt with iCal but try setting the headers to force revalidation.
您是否尝试过添加“无缓存”标头?
Have you tried adding "no-cache" headers?