innerjoin

innerjoin | iCalendar
Innerjoin Home Up Help

Sunbird and Mozilla Calendar Notes and Queries

Using Mozilla or Firefox with the calendar extension? or the stand-alone Sunbird?

These notes are written round Calendar 0.8 with Mozilla 1.1, the stable release as of September 2002, on a Linux client

They were revisited and revised to bring them up to date for Sunbird 0.2, January 2005

Notes and Queries

Gzip compressed calendar data

Publishing an events calendar and finding that .ics files can become very large? .ics files can be compressed with gzip to 10% of their original size. Mozilla can still subscribe to them.

For details of gzip, see the GNU documentation or O'Reilly's nutshell.

Compressing .ics to .icz files

If you compress the .ics file with gzip and then renaming the .gz file to .icz, for example under Linux by:

This can reduce the size of the file to 10% of the original. Sunbird, Firefox or Mozilla can still download, decompress and read the data. (Beware however as other applications such as Evolution may not be able to handle the compressed format)

Using compressed calendars is of use for sites publishing events data rather than personal diaries, they would generate the .ics files, compress them and upload them to their sites through their normal procedures. Mozilla does not compress calendar data when uploading calendars.

MIME types and Content Encodings

If you get binary displayed then this is a sign that the Content Encoding information is (or was) not set. The data is being downloaded in a compressed, binary, form and Mozilla is not being told it is really 'gzip'd data.

If you get plain text displayed then this is a sign that the MIME type is (or was) not set. .icz files also need to be set up with a text/calendar MIME type so that Mozilla will launch the calendar and subscribe to the events list rather than display the data as text.

Check the page information, page info under the the view menu in Mozilla, if it says

then set the MIME type on the server and clear Mozilla's disc and memory cache. (It may also be text/html depending on the default MIME type is configured within Apache).

Mozilla caches the data about the file as well as the file. If changing the Content Encoding or MIME type configurations on the server you will probably have to clear Mozilla's disc cache and reload the page after every experiment.

Linux and Apache configuration

Setting the Content Encoding

These two server settings can be done fairly simply in Apache. First is to ensure that the gzip'd data is downloaded with a:

header line. If the server does not send this line then Mozilla may display the content as binary (or not at all).

Content-Encoding settings are controlled with the AddEncoding directive, if the line:

is added to the .htaccess file (which is under control of the webmaster rather than the server administrator) then Apache will return a header with the file.

There's useful information about .htaccess files in the Using .htaccess tutorial and the Apache configuration files documentation.

After this step the compressed file is uncompressed by Mozilla as it is downloaded. It is saved as a text file in the cache and no longer displayed as compressed binary.

To test this you can use telnet to Port 80 - although the normal caveats apply for people behind firewalls who are forced to use HTTP proxy servers.

Setting the MIME type

The second step is to set the MIME type with the AddType command. This is similar to the step required for ics files:

With this in place (and the Mozilla's cache being emptied), downloading a .icz file should launch Mozilla Calendar.

If you have the text/calendar MIME type set for .icz files but not the content encoding then you are likely to download the compressed file 'as is' and get nothing displayed in the calendar

Testing

A telnet session is fine for testing. Connect to the webserver with:

and type the HTTP commands:

should give you a stream of compressed data with header lines:

If Mozilla does not see the Content-Encoding line, it doesn't and indeed shouldn't, uncompress the data. If it does not see the Content-Type line it will not launch the Calendar (well, unless the link to the data is a webcal link).

(There's a little more information in the mod_gunzip howto)

Navigation: [ Home ] [ Index ] [ Site Map ] [ Translate ] [ Up ] [ What's New ]
Mail: mgk@iv.mmv.innerjoin.org, 2002/10/08
URI: http://www.innerjoin.org/iCalendar/gzipped-calendar-data.html
Keywords:innerjoinorg200112, innerjoinorg, innerjoin, mozilla, calendar, howto, gzip