Skip to content
This repository
Browse code

cache raw Instagram response instead of parsed JSON

  • Loading branch information...
commit 86534959c169ec2759db0dd60b3430370684c046 1 parent ccf772a
Mislav Marohnić authored

Showing 2 changed files with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  app.rb
  2. +1 1  instagram.rb
2  app.rb
@@ -216,7 +216,7 @@ def last_modified_from_photos(photos)
216 216 get '/users/:id.json' do
217 217 user = User[params[:id]]
218 218 callback = params['_callback']
219   - raw_json = user.photos(params[:max_id], true)
  219 + raw_json = user.photos(params[:max_id], :raw_json)
220 220
221 221 content_type "application/#{callback ? 'javascript' : 'json'}", charset: 'utf-8'
222 222 expires 1.hour, :public
2  instagram.rb
@@ -57,10 +57,10 @@ def connection
57 57 b.use OAuthRequest, config: self
58 58 b.request :url_encoded
59 59 b.use Mashify
60   - b.use FaradayStack::Caching, cache, strip_params: %w[access_token client_id] unless cache.nil?
61 60 b.response :raise_error
62 61 b.use FaradayStack::ResponseJSON, content_type: 'application/json'
63 62 b.use PreserveRawBody
  63 + b.use FaradayStack::Caching, cache, strip_params: %w[access_token client_id] unless cache.nil?
64 64 b.use FaradayStack::Instrumentation
65 65 b.adapter Faraday.default_adapter
66 66 end

0 comments on commit 8653495

Please sign in to comment.
Something went wrong with that request. Please try again.