Skip to content

Commit

Permalink
Added expire headers for 1 day
Browse files Browse the repository at this point in the history
  • Loading branch information
nchapman committed Apr 27, 2015
1 parent e01dd77 commit 9328333
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/embedly_controller.rb
Expand Up @@ -11,6 +11,9 @@ def extract
$redis.expire(request_hash, 1.day)
end

# ask client to cache for one day
response.headers['Expires'] = 1.day.from_now.httpdate

render body: result, content_type: params[:callback] ? 'application/javascript' : 'application/json'
end

Expand Down
3 changes: 3 additions & 0 deletions app/controllers/favicons_controller.rb
Expand Up @@ -5,6 +5,9 @@ def get
fetch_favicon(params[:url])
end

# ask client to cache for one day
response.headers['Expires'] = 1.day.from_now.httpdate

send_data data.read, type: 'image/x-icon', disposition: 'inline'
end

Expand Down

0 comments on commit 9328333

Please sign in to comment.