Permalink
Browse files

even farther future expires, use send_data to stream instead of File#…

…read
  • Loading branch information...
croaky committed Nov 17, 2010
1 parent 8cbf46e commit 0cbf37769ab048dfd3715e6e12be44c69edb8a64
Showing with 3 additions and 3 deletions.
  1. +3 −3 app.rb
View
6 app.rb
@@ -7,8 +7,8 @@ class App < Sinatra::Base
set :app_file, __FILE__
before do
- headers 'Cache-Control' => 'public, max-age=86400',
- 'Expires' => (Time.now + 86400).httpdate,
+ headers 'Cache-Control' => 'public, max-age=31536000',
+ 'Expires' => (Time.now + 31536000).httpdate,
'Access-Control-Allow-Origin' => '*'
end
@@ -20,6 +20,6 @@ class App < Sinatra::Base
when /\.eot$/ then 'application/vnd.ms-fontobject'
when /\.svg$/ then 'image/svg+xml'
end
- open("#{ENV['S3_URL']}/#{params[:font_face]}").read
+ send_data open("#{ENV['S3_URL']}/#{params[:font_face]}")
end
end

0 comments on commit 0cbf377

Please sign in to comment.