Permalink
Browse files

Fixed issue with getting blank assets every second request when using…

… mod_passenger.

Signed-off-by: Sean Cribbs <seancribbs@gmail.com>
  • Loading branch information...
1 parent d7eac1b commit 7fc5476439570fc9b742011e2942f54b8b5b36fe @ihoka ihoka committed with seancribbs Aug 14, 2009
Showing with 2 additions and 8 deletions.
  1. +2 −8 lib/sns/site_controller_ext.rb
@@ -36,19 +36,13 @@ def parse_url_for_text_assets
end
def set_text_asset_cache_control
- if (request.head? || request.get?)
- expires_in Sns::Config['cache_timeout'], :public => true, :private => false
- else
- expires_in nil, :private => true, "no-cache" => true
- headers['ETag'] = ''
- end
+ expires_in Sns::Config['cache_timeout'], :public => true, :private => false
end
def process_text_asset(text_asset, asset_type)
response.body = text_asset.render
- response.headers['Status'] = ActionController::Base::DEFAULT_RENDER_STATUS_CODE
+ response.status = ActionController::Base::DEFAULT_RENDER_STATUS_CODE
response.headers['Content-Type'] = Sns::Config["#{asset_type}_mime_type"]
- response.headers['Last-Modified'] = text_asset.effectively_updated_at.httpdate
end
end
end

0 comments on commit 7fc5476

Please sign in to comment.