innerjoin |
|
| innerjoin | iCalendar | |
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
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.
If you compress the .ics file with gzip and then renaming the .gz file
to .icz, for example under Linux by:
gzip -9 events.ics && mv events.ics.gz events.icz
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.
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
Type: text/plain
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.
These two server settings can be done fairly simply in Apache. First is to ensure that the gzip'd data is downloaded with a:
Content-Encoding: gzip
Content-Encoding settings are controlled with the
AddEncoding
directive, if the line:
AddEncoding gzip .icz
.htaccess file (which is under control of
the webmaster rather than the server administrator) then Apache will return a header
Content-Encoding: gzip
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.
The second step is to set the MIME type with the
AddType
command. This is similar to the step required for
ics files:
AddType text/calendar .icz
.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
A telnet session is fine for testing. Connect to the webserver with:
telnet www.yourmachine.com 80
and type the HTTP commands:
GET /events.icz HTTP/1.1
Host: www.yourmachine.com
Accept-Encoding: gzip
<cr>
should give you a stream of compressed data with header lines:
Content-Type: text/calendar
Content-Encoding: gzip
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)