Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a CalDAV server in Rails

I know i can use the iCalendar gem to generate the ics files I need to serve, but how would I go about serving them, readonly, via the CalDAV protocol in Rails?

like image 722
Mohamed Hafez Avatar asked Sep 26 '13 23:09

Mohamed Hafez


People also ask

How do I create a CalDAV server?

To setup CalDAV, simply go to the “Mail, Contacts, and Calendars” page under “Setting”, click “Add Account”, click “Other”, and click “Add CalDAV Account”. Enter the URL to the CalDAV server, followed by the username and a calendar name, then enter the username and password.

What is a CalDAV server?

CalDAV is an extension of WebDAV that provides a standard for clients to access calendar information on a remote server. Google provides a CalDAV interface that you can use to view and manage calendars using the CalDAV protocol.

Is ical the same as CalDAV?

CalDAV is a protocol extension for WebDAV and can used to manipulate data in the iCalendar format. So CalDAV is like the HTTP for calendar stuff, and iCalendar is like HTML. People on the internet use the terms icalendar and CalDAV interchangeably. "so caldav is like the http for calender stuff, and ical is like html".


2 Answers

If all you need is a readonly calendar like me, you don't need CalDAV at all, you can just serve up the .ics file the way you would any other file, and your users can import the calendar on Google Calendar, iCal, and other calendar apps. Be wary though that Google Calendar will only update every 12-24 hours unfortunately. iCal works beautifully though, updating every time you open the app and fetching at whatever interval you like in the background.

like image 137
Mohamed Hafez Avatar answered Sep 25 '22 19:09

Mohamed Hafez


The disadvantage of serving the whole calendar in a single iCalendar entity (via HTTP GET) vs using CalDAV is that on every little change, you need to resend the whole calendar (all events - changed or not) back to the client.

With CalDAV you only need to send back the events which actually changed.

Doesn't matter for small calendars, but for large ones (which receive updates) the difference is obviously huge.

like image 34
hnh Avatar answered Sep 22 '22 19:09

hnh