Created
May 2, 2012 19:59
-
-
Save kristenhazard/2579833 to your computer and use it in GitHub Desktop.
Configuring rack-offline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kitfox::Application.routes.draw do | |
offline = Rails::Offline.configure :cache_interval => 30 do | |
cache_buster_timestamp = "20120429" | |
files = Dir[ | |
"#{root}/**/*.html", | |
"#{root}/stylesheets/**/*.css", | |
"#{root}/javascripts/**/*.js", | |
"#{root}/images/**/*.*"] | |
files.each do |file| | |
file = file + "?" + cache_buster_timestamp | |
cache Pathname.new(file).relative_path_from(root) | |
end | |
network "*" | |
end | |
match "/application.manifest" => offline | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment