Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add HTTP caching (closes #2)

  • Loading branch information...
commit 6e96a3f7e10310d84919100d6abdd6834da5bd4e 1 parent c970a89
@judofyr judofyr authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 timeless.rb
View
4 timeless.rb
@@ -39,6 +39,7 @@ def service(*a)
module Timeless::Controllers
class Index
def get
+ @headers['Cache-Control'] = 'public, max-age=3600'
@change = Change.last
render :index
end
@@ -55,6 +56,7 @@ def get
class Changelog < R '/changelog'
def get
+ @headers['Cache-Control'] = 'public, max-age=3600'
@changes = Change.all
render :changes
end
@@ -62,6 +64,7 @@ def get
class ChangelogN
def get(id)
+ @headers['Cache-Control'] = 'public, max-age=3600'
@change = Change.new(id)
case @change.type
when :entry
@@ -84,6 +87,7 @@ def get
class Entry < R '/(.+?)'
def get(name)
+ @headers['Cache-Control'] = 'public, max-age=3600'
@entry = Models::Entry.new(name)
if @entry.file?
Please sign in to comment.
Something went wrong with that request. Please try again.