Permalink
Browse files

cache raw Instagram response instead of parsed JSON

  • Loading branch information...
1 parent ccf772a commit 86534959c169ec2759db0dd60b3430370684c046 @mislav committed Aug 30, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 app.rb
  2. +1 −1 instagram.rb
View
2 app.rb
@@ -216,7 +216,7 @@ def last_modified_from_photos(photos)
get '/users/:id.json' do
user = User[params[:id]]
callback = params['_callback']
- raw_json = user.photos(params[:max_id], true)
+ raw_json = user.photos(params[:max_id], :raw_json)
content_type "application/#{callback ? 'javascript' : 'json'}", charset: 'utf-8'
expires 1.hour, :public
View
@@ -57,10 +57,10 @@ def connection
b.use OAuthRequest, config: self
b.request :url_encoded
b.use Mashify
- b.use FaradayStack::Caching, cache, strip_params: %w[access_token client_id] unless cache.nil?
b.response :raise_error
b.use FaradayStack::ResponseJSON, content_type: 'application/json'
b.use PreserveRawBody
+ b.use FaradayStack::Caching, cache, strip_params: %w[access_token client_id] unless cache.nil?
b.use FaradayStack::Instrumentation
b.adapter Faraday.default_adapter
end

0 comments on commit 8653495

Please sign in to comment.