mirror of
https://github.com/neocities/neocities.git
synced 2025-04-28 11:12:30 +02:00
Cache for 10 seconds
This commit is contained in:
parent
a0299d0e46
commit
79a517da96
1 changed files with 3 additions and 1 deletions
4
app.rb
4
app.rb
|
@ -14,6 +14,8 @@ get %r{.+} do
|
||||||
base_path = site_base_path subname
|
base_path = site_base_path subname
|
||||||
path = File.join(base_path, (request.path =~ /\/$/ ? (request.path + 'index.html') : request.path))
|
path = File.join(base_path, (request.path =~ /\/$/ ? (request.path + 'index.html') : request.path))
|
||||||
|
|
||||||
|
cache_control :public, max_age: 10
|
||||||
|
|
||||||
if File.exist?(path)
|
if File.exist?(path)
|
||||||
send_file path
|
send_file path
|
||||||
else
|
else
|
||||||
|
@ -110,4 +112,4 @@ end
|
||||||
|
|
||||||
def template_site_title(username)
|
def template_site_title(username)
|
||||||
"#{username.capitalize}#{username[username.length-1] == 's' ? "'" : "'s"} Site"
|
"#{username.capitalize}#{username[username.length-1] == 's' ? "'" : "'s"} Site"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue