From 79a517da962deef9781ce744f32b473b3d5b44ea Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Mon, 3 Jun 2013 00:04:57 -0700 Subject: [PATCH] Cache for 10 seconds --- app.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 5711ce1a..cfaa0190 100644 --- a/app.rb +++ b/app.rb @@ -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 \ No newline at end of file +end