Cache for 10 seconds

This commit is contained in:
Kyle Drake 2013-06-03 00:04:57 -07:00
parent a0299d0e46
commit 79a517da96

4
app.rb
View file

@ -14,6 +14,8 @@ get %r{.+} do
base_path = site_base_path subname
path = File.join(base_path, (request.path =~ /\/$/ ? (request.path + 'index.html') : request.path))
cache_control :public, max_age: 10
if File.exist?(path)
send_file path
else
@ -110,4 +112,4 @@ end
def template_site_title(username)
"#{username.capitalize}#{username[username.length-1] == 's' ? "'" : "'s"} Site"
end
end