Cache Youtube API XML response with Nokogiri error - Marshalling error?

Eran

New Member
I would like to minimize my calls to the Youtube API as this data doesn't refresh often. When I try to cache this:\[code\]Rails.cache.fetch("youtube-#{@yt_name}", :expires_in => 1.day) do @youtube_doc = Nokogiri::XML(open("https://gdata.youtube.com/feeds/api/users/#{@yt_name}/uploads"))end\[/code\]I get an error in heroku:\[code\]Marshalling error for key 'youtube-NAME': no marshal_dump is defined for class Nokogiri::XML::NodeSet You are trying to cache a Ruby object which cannot be serialized to memcached.\[/code\]Any ideas?
 
Back
Top