Closed Bug 847707 Opened 12 years ago Closed 12 years ago

Add an API endpoint for homepage

Categories

(Marketplace Graveyard :: API, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2013-03-28

People

(Reporter: cvan, Assigned: andy+bugzilla)

References

Details

(Whiteboard: [fireplace] p=1)

We have an endpoint for categories. We need to add one for featured apps (bug 847659). Let's combine the two as one API endpoint to match what we have in Flue: https://github.com/mozilla/fireplace/blob/master/flue/main.py#L87
Whiteboard: [fireplace]
Why would we combine these two? Fireplace can just make a call for featured apps and a call for categories.
(In reply to Wil Clouser [:clouserw] from comment #1) > Why would we combine these two? Fireplace can just make a call for featured > apps and a call for categories. Why do two HTTP requests when we could do one?
(In reply to Chris Van Wiemeersch [:cvan] from comment #2) > Why do two HTTP requests when we could do one? To elaborate on this: The long-term plan is to have three endpoints for the homepage: /homepage /featured /categories In Flue, /featured looks like [{app}, {app}, ...] /categories looks like [{category}, {category}, ...] and /homepage is simply { featured: [{app}, {app}, ...], categories: [{category}, {category}, ...] } Flue actually just calls the view functions and sticks their output into a dict and JSONizes it. The purpose behind this is two-fold: /homepage contains all the information necessary to load the page. Latency (not bandwidth) is our biggest enemy on mobile, and decreasing requests is super important. The other two endpoints are necessary because we know that /categories is very rarely going to change, so after the first load, we can request /featured instead of /homepage (and use the cached categories from the first load). This will be a pretty significant bandwidth savings without adding latency. The first step, though, is making sure that we have a dedicated homepage API that we can get everything we need in one go.
I think it bears repeating: Every single HTTP request we can avoid is worth avoiding. If we could avoid HTTP requests by simply concatting API responses on the server, why *wouldn't* we?
When you write the homepage method that concatenates the two, please summarize this bug (or link to it) in comments. Thanks.
Priority: -- → P3
Whiteboard: [fireplace] → [fireplace]p=1
Priority: P3 → P1
Whiteboard: [fireplace]p=1 → [fireplace] p=1
This is very high priority. Can someone please
Depends on: 847659
Assignee: nobody → amckay
Target Milestone: --- → 2013-03-28
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 859511
You need to log in before you can comment on or make changes to this bug.