问题
I have a PHP generated .ics calendar file on my server.
Several clients are subscribed to this calendar, e.g. using Google Calendar and Apple iCal/Calendar.
I want to delete the calendar and all events in it, in a way that it is also removed from the clients.
It seems that if I delete the .ics file, the events will still exist in the clients.
Should I keep an empty .ics file? Or is there some syntax I should use to instruct the clients that the calendar is no longer to be used?
回答1:
In HTTP the way to tell clients that the resource no longer exists, is to emit a 404 Not Found
or a 410 Gone
status code.
However, even though this is the 'correct way', in practice most clients won't automatically do something with this information.
I do think that this is the 'most correct' though, because calendar clients do tend to add a 'warning' or 'error' icon to the calendar, signaling the user that something is wrong (so they can manually clean it up).
However, if you just want the events to disappear automatically, your only option is to publish a calendar with 0 events.
来源:https://stackoverflow.com/questions/32700940/ical-how-do-i-delete-an-ics-file-that-has-subscriptions