开发者

How to change default behavior of Rack::Offline

I am trying to cache my pages in the views folder. I got this from the rack::Offline page but I can't figure out where I am suppsoe to add the code.

offline = Rack::Offline.configure do
  cache "contacts/list." # contacts is the folder in views folder where my list.html.erb file is located
  public_path = Rails.public_path
  Dir[public_path.join("javascripts/*.js")].each do |file|
    cache file.relative_path_from(public_path)
  end
end
开发者_StackOverflow

Thanks in advance.


It goes in your routes.rb file. Some good information in this answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜