Closed Bug 936015 Opened 11 years ago Closed 10 years ago

Prevent useless geoip lookup in APIs that don't need it

Categories

(Marketplace Graveyard :: API, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2014-10-07

People

(Reporter: mat, Assigned: mat)

References

Details

(Keywords: perf, Whiteboard: [repoman][qa-])

The rocketfuel client doesn't necessarily pass 'region' parameter to the API, because the user can want to see collections without region filtering, for instance. It works fine in the rocketfuel APIs, except that the region middleware does a geoip lookup because of this. That lookup is useless in rocketfuel, we should prevent it somehow.
Priority: -- → P2
Also affects rocketbar suggestion API, and possibly other APIs that just don't need/rely on the region. We should make request.REGION completely lazy or figure out a way for an API to opt out of the geoip detection, which can hurt performance.
Summary: Prevent useless geoip lookup in rocketfuel APIs → Prevent useless geoip lookup in APIs that don't need it
Andy: do you know if any payments-related APIs need geoip ? I'm thinking we should remove the middleware entirely, at least for API v2, and only call geoip explicitely in APIs that want it (consumer-info is the most obvious one)
Assignee: nobody → mpillard
Flags: needinfo?(amckay)
Whiteboard: [repoman]
No that should be fine, pretty much all payment flows go through webpay. Less middleware calls ftw.
Flags: needinfo?(amckay)
The middleware is still used to automatically set request.REGION from query parameters so I had to leave it, but this PR https://github.com/mozilla/zamboni/pull/2608 deactivates the automatic geoip lookup for API v2.
Status: NEW → ASSIGNED
Target Milestone: --- → 2014-10-07
Fixed in https://github.com/mozilla/zamboni/commit/5f2f686190d63e969b267ae5bb0266e022d6c38f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: perf
Resolution: --- → FIXED
Whiteboard: [repoman] → [repoman][qa-]
You need to log in before you can comment on or make changes to this bug.