Can I stop iCal from caching the iCalendar PHP channel I created?

I created a dynamically created iCalendar channel with PHP, adhering to RFC 5545. It works fine, for the most part, except that iCal (that is, the Mac OS X calendar built-in program) seems to refuse to reflect updates to events it had previously downloaded. I assume this is due to caching. Is there a way I can tell iCal not to cache my channel?

EDIT: Oh yes, I forgot to mention that I already tried to make each VEVENT with a different UID every time the channel is called (my UID format is โ€œidโ€, where the current time in RFC 5545 is DATE-TIME, and is a unique identifier for the event in my database). I also tried playing with the Content-type in the header; this problem occurs if I set it to text / plain or text / calendar

+4
source share
2 answers

I have never worked on iCal, but am trying to set up the headers for re-checking.

<?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 ?> 
+2
source

Have you tried adding the no-cache headers?

 <?php header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); //date in the past header( 'Last-Modified: ' . gmdate( 'D, d MYH: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' ); ?> 
+2
source

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


All Articles