Quick search reveals something called #useGZipTransfer and
#useGZipTransfer:, perhaps you could just set that property on a Seaside adaptor? If not, Apache proxying your Seaside server can do compression for you (you may need to turn off HTTP chunking of responses). Regards, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 http://tinyurl.com/r7uw4 -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Bob Nemec Sent: Monday, September 21, 2009 8:57 AM To: [hidden email] Subject: [Seaside] iCal to Drupal requires Content-Encoding: gzip Hello, We're trying to provide an iCal feed from Seaside (on VW) to Drupal. The Drupal use of the feed can be tested using a Google calendar iCal feed, and it works fine. We're able to produce a simple iCal document as well, but Drupal does not accept it. Both the Google and our Seaside iCal feeds download fine with just the browser. The one big difference we can see in the header is that the Google contains 'Content-Encoding: gzip' and ours does not. I have not be able to determine how we can properly provide the gzip compressed version of the content. Has anyone done an iCal feed from Seaside to Drupal? Or, how can I get the gzip properly to be properly supported in my data source? Thanks for any help, Bob Nemec Cherniak Software ---- Here are some details... Documentation on iCal in Drupal ... http://drupal.org/node/341716 http://www.drupalove.com/drupal-video/ical-events-nodes I'm packaging the response with... (aFilename=events.ics, aContent is a read stream on the string) WAResponse new contentType: 'text/calendar;charset=utf-8'; doNotCache; headerAt: 'Content-Disposition' put: 'attachment; filename="' , aFileName , '"'; headerAt: 'Content-length' put: aContents size printString; contents: aContents; yourself It looks like SeasideHttpWriteHandler>>prepareStream:forMessageBody: will do the compression with GZipWriteStream if useGZipTransfer = true, but I can't find a way to propagate that setting, and so far none of my attempts at hacking it are working. I had hoped something as simple as adding #headerAt: 'Content-Encoding' put: 'gzip' would work, but that just creates an invalid file. To see the header contents, we use the Live HTTP headers Firefox plug in. This is the Google header... http://www.google.com/calendar/ical/<our test calendar ics file> GET /calendar/ical/<our test calendar ics file> HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: <some cookie data> HTTP/1.x 200 OK Content-Type: text/calendar; charset=UTF-8 Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: Fri, 01 Jan 1990 00:00:00 GMT Date: Mon, 21 Sep 2009 00:14:03 GMT Content-Encoding: gzip X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN Content-Length: 3421 Server: GFE/2.0 ---------------------------------------------------------- And this is our Seaside header... http://localhost:48199/seaside/Test GET /seaside/Test HTTP/1.1 Host: localhost:48199 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://localhost:48199/seaside Cookie: <some cookie data> HTTP/1.x 200 OK Expires: Wed, 11 Jun 1980 08:00:00 -0400 Cache-Control: no-cache,must-revalidate Pragma: no-cache Content-Disposition: attachment;filename=events.ics Content-Type: text/calendar;charset=utf-8 Content-Length: 10944 ---------------------------------------------------------- -- View this message in context: http://www.nabble.com/iCal-to-Drupal-requires-Content-Encoding%3A-gzip-t p25530382p25530382.html Sent from the Squeak - Seaside mailing list archive at Nabble.com. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2009/9/21 Bob Nemec <[hidden email]>:
> > Hello, > We're trying to provide an iCal feed from Seaside (on VW) to Drupal. Cool. > The > Drupal use of the feed can be tested using a Google calendar iCal feed, and > it works fine. We're able to produce a simple iCal document as well, but > Drupal does not accept it. Both the Google and our Seaside iCal feeds > download fine with just the browser. > > The one big difference we can see in the header is that the Google contains > 'Content-Encoding: gzip' and ours does not. I have not be able to determine > how we can properly provide the gzip compressed version of the content. It is unlikely that Drupal needs the content as gzip. Have you compared the actual data? Does the format and encoding match? Do you use CR LR and not just LF or CR? Are you sure content-length matches the lenght of your content? Have you tried returning the same thing as Google just without gzip (and a correct content-lenght). Have you tried dropping the content-disposition header? ... > Has anyone done an iCal feed from Seaside to Drupal? Not with Drupal. > Or, how can I get the > gzip properly to be properly supported in my data source? I don't think this is your problem. Cheers Philippe _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |