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
2
app.rb
2
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue