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
开发者_StackOverflowThanks in advance.
It goes in your routes.rb file. Some good information in this answer.
精彩评论