We can roll the new featured tag[s] into /discover
Pros: No extra HTTP requests on the client
Cons: Kind weird, especially with pagination. Larger payload sizes.
GET /disover
{
"projects": [{ /* Projects with the featured flag set to true */ }, ...],
"featuredTags": {
"mozfest2015": [{ /* projects tagged mozfest2015 */ }, ...],
"makerparty2016": [{ /* projects tagged mozfest2015 */ }, ...]
}
}
Option 1:
Since
/discover
is already an app/view specific route could we just interpolate the results with projects that have featured tags? This might make pagination less weird...eg:
Option 2:
This will still require multiple requests for the Discover view because there will be different routes for projects featured by admin flag and by hashtag. Worse, we'll have to make 2 requests for each additional "page" of data.
Option 3:
Certainly seems the most traditional for an API, but yeah, the HTTP requests will be numerous.
Could we alternatively send an array of tags in JSON to
/projects
as a filter? This would bring it down to 2 initial requests at least. One for the featured tag list and one for each additional page of filtered results.