Skip to content

Commit

Permalink
add sinatra caching to static pages
Browse files Browse the repository at this point in the history
  • Loading branch information
samir1 committed May 1, 2015
1 parent 6f75ae2 commit 86e9a0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def username
end
end


get '/' do
if session[:username]
erb :timeline
Expand All @@ -53,6 +54,7 @@ def username
end

get '/login' do
response.headers['Cache-Control'] = 'public, max-age=31536000'
erb :login_form
end

Expand Down Expand Up @@ -85,6 +87,7 @@ def username


get '/user/profile' do
response.headers['Cache-Control'] = 'public, max-age=500'
erb :profile
end

Expand All @@ -99,6 +102,7 @@ def username
end

get '/user/register' do
response.headers['Cache-Control'] = 'public, max-age=31536000'
erb :register
end

Expand Down

0 comments on commit 86e9a0f

Please sign in to comment.