cffeed and gzip compression
March 29, 2008
I've just discovered that the cffeed tag in ColdFusion 8, can't consume RSS feeds that have use gzip compression. You get the error message "Unable to read the source URL. unknown compression method" This is a known bug so I hope that there will be a hot fix for this soon. For now, the official Adobe way around this is:
If you use the cffeed tag to read feed URLs that require header
Accept-Encoding: gzip or deflate to be set on connection, you
may see the "unknown compression format" error message.
To avoid this issue, read the feed with the cfhttp tag with
encoding using the cfhttpparam tag, save the content in a file, and
then use the file as the source for the cffeed tag.
For more information read the ColdFusion 8 Release Notes (PDF)
Example code:
<cfset myFile = CreateUUID() & ".xml" /> <cfhttp url="http://movies.msn.com/rss/topcelebs" path="#GetTempDirectory()#" file="#myFile#"> <cfhttpparam type="header" name="Accept-Encoding" value="compress,gzip,deflate" /> </cfhttp> <cffeed action="read" source="#myFile#" name="rssFeed" />
- Posted in:
- ColdFusion
No comments
Leave a comment
If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)
