1

Due to the new pagination of the /sites method in v1.1 of the API, we have to go through all the pages of sites to check whether a site exists, or allow the user to search for a site.

Would it be possible to provide a way to search the list instead?

2 Answers 2

6

For now, as we have only ~80 sites, you can set pagesize to 100 and get them all.

But in general, I think pagination here makes no sense at all. Because there're no search parameters or ordering, I can't think of a situation where app can fetch only first page and be satisfied.

Would it be possible to provide a way to search the list instead?
I would propose just getting the whole list of sites, caching it (as documentation recommends) and searching locally.

10 Comments

+1 I really don't see the benefit of pagination on the /sites results. I'm never going to want only some of the sites; I want all or nothing.
Same I think pagination is a waste of bandwidth, in that it adds a few lines at the top, also it wastes effort.
What I've done is create a cron script that runs every 24 hours, polls /sites, and sticks the results into a MySQL database. That way I can search, re-order, and do all manner of things with it.
@George; but how does that affect the pagination? The script still has to multiple requests (at least it will do when there's more than 100 sites, and if you take a look at Area 51 that's going to happen pretty soon)
@Jonathan: It does affect me - and it affects you too. I'm just saying that in the meantime, I have a method for dealing with this.
|
1

Pagination on /sites is solely so [app]s don't have to pull down any unknown, large, and constantly growing chunk of a data in a single request.

It is expected that every consumer would grab all sites in a series of sequential (or concurrent, if they're comfortable with that) requests for each page.

1 Comment

Well please keep the 1.0 version, during 2.0 and beyond. The pagination makes no sense. When would an app only show one page of sites? you say that you'd expect every consumer would make multiple requests? Surely it's better to avoid the multiple requests?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.