开发者

How to control when a remote iCal (.ics) file has been updated and the calendar should sync?

开发者 https://www.devze.com 2023-02-19 15:59 出处:网络
I\'m working on a system in asp.net 4 (web forms) which manages events and sends out emails about these to the customers.

I'm working on a system in asp.net 4 (web forms) which manages events and sends out emails about these to the customers.

I've created a page which dynamically creates an .ics file based on data from our database, that customers can download to add the events to Outlook and iCalendar. This file is sent through the Response, so I don't actually store the file on the server. Since I can provide a webcal:// address to this file, it can also be synced whenever someone changes the settings for an event in our system.

Example .ics: webcal://www.abc.com/get-ics.aspx?id=123

However, since our customers sync with a dynamically generated file, this forces our server to generate the file every time their calendar application wants to sync. And since this will cause a couple of hundred thousand requests every hour, the server will take quite a bit of punishment.

So my actual question is: How does Outlook and other calendar applications know when an ics-file has been updated and needs to fetch the updated file? I need to m开发者_开发知识库anage this to only generate a new file when there has been an actual update, and not on every single request. The main problem is that we do not wish to store the actual files on the server.


Start a service that polls the file and checks for HTTP change headers. If there are changes redownload it. Precise implementation I don't know. But this should be a starting point.


> How does Outlook and other calendar applications know 
> when an ics-file has been updated and needs to fetch the updated file?

each calenderentry has a uniqueid, a last modification and is assoziated with one or more users.

  • The client can ask give me all changes since 2002-12-24 for userid=123
  • or the server that generates one ical file per user give that file the modificationdate of the newest entry

Note this does not handle entries that are removed from calender

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号