diff --git a/app.rb b/app.rb index 95cf1a1..3f5e0cb 100644 --- a/app.rb +++ b/app.rb @@ -147,14 +147,17 @@ class Sidebar end $sidebar = Sidebar.new +$files_cache = {} def pview(file) body = "" cont = File.read(file) or return "Not found" if (file =~ /\.erb$/) + # We can't cache erb tp = ERB.new(cont) body = tp.result(binding) elsif (file =~ /\.md$/) - body = $markdown.render cont + # But we can cache markdown + body = ($files_cache[file] ||= $markdown.render cont) end put_in_layout(body) end diff --git a/deploy b/deploy new file mode 100755 index 0000000..cc529f8 --- /dev/null +++ b/deploy @@ -0,0 +1,4 @@ +#!/usr/bin/sh + + +RUBY_YJIT_ENABLE=1 rackup \ No newline at end of file