Created
December 29, 2009 11:53
-
-
Save jstorimer/265267 to your computer and use it in GitHub Desktop.
This file contains 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
require 'masquerade' | |
run Sinatra::Application |
This file contains 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
require 'rubygems' | |
require 'sinatra' | |
set :public, Proc.new { File.join(root, "_site") } | |
# This before filter ensures that your pages are only ever served | |
# once (per deploy) by Sinatra, and then by Varnish after that | |
before do | |
response.headers['Cache-Control'] = 'public, max-age=31557600' # 1 year | |
end | |
get '/' do | |
File.read('_site/index.html') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment