我已尝试使用此代码缓存从flickr中提取用户名。但是,每次进入页面时加载大约需要10秒钟。
- cache do
- flickr.photos.search(:user_id => 'userid').each do |pic|
- unless pic.id == 'picid'
- photo_info = flickr.photos.getInfo(:photo_id => pic.id)
- photo_url = FlickRaw.url_z(photo_info)
- thumbnail = FlickRaw.url_s(photo_info)
%div{"data-src" => "#{photo_url}", "data-thumb" => "#{thumbnail}"}
.camera_caption.fadeFromBottom
#{pic.title}