2011-12-02 23 views
2

我創建了channelfile爲FB如何設定的截止日期在Rails FB聲道文件3

cache_expire = 60*60*24*365 
response.headers["Pragma"] = "public" 
response.headers["Cache-Control"] = "max-age=#{cache_expire}" 
response.headers["Expires"] = ... # gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT'); 

如何設置了「過期」的價值在Rails 3的?

回答

2
response.headers["Expires"] = Time.at(Time.now.to_i + cache_expire).strftime("%D, %d %M % Y %H:%i:%s) 
1

我創建了一個自動將引擎掛載到/channel.html的gem。您可以簡單地在您的Gemfile中包含'fb-channel-file'更多信息在我的答案another question

相關問題