Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(paging) Add ability to opt-out of force paging #160

Closed
atruskie opened this issue Feb 26, 2015 · 7 comments
Closed

feature(paging) Add ability to opt-out of force paging #160

atruskie opened this issue Feb 26, 2015 · 7 comments

Comments

@atruskie
Copy link
Member

Currently when the query results of an API endpoint exceed 500 items, the results are automatically paged.

Add the option to opt out of this behaviour.

e.g. add a dont_page QSP for normal routes
and a dont_page attribute to the paging object used in filter objects

@cofiem
Copy link
Contributor

cofiem commented Feb 26, 2015

The whole point of having the paging there is to guard against the API accidentally (or on purpose) slowing the website to a crawl. If the paging can be turned off, what's the point of having it?

Some other options:

  • can the client cope with paging the results?
  • is there some other way to aggregate the results on the server?

@atruskie
Copy link
Member Author

Guarding against accidents is fine. Choosing to do advanced things is something else.

Simply put, I'm currently, in prod, just setting the items per page property to 100,000 - I'm getting around the limit with a hack. I thought it would be better to make the option explicit - because at least the intention is explicit - readable and even deprecated able.

I'm not really sure what advantage paging that much data would have in the client. For the visualise case I need all of it... so I'd just fetch all the pages sequentially.... which is slower for the client and is effectively the same load on the server.

Aggregating results is a possibility - but at this stage it seems quite complicated... at some point I potentially need the information for arbitrary items...

Additionally, rails doing a ton of useless processing (5:30 worth in the current example) is sheerly ridiculous... I'd say the server should be working smarter, not imposing arbitrary limits.

@cofiem
Copy link
Contributor

cofiem commented Feb 26, 2015

Good points. I'll have a look at how this could be done in a smarter/less resource-intensive way.

@cofiem
Copy link
Contributor

cofiem commented Mar 7, 2015

add qsp disable_paging=true or

"paging": {
    "disable_paging": "true"
}

@atruskie
Copy link
Member Author

atruskie commented Mar 7, 2015

👍

@atruskie
Copy link
Member Author

atruskie commented Mar 7, 2015

I updated the relevant wiki entries

@cofiem
Copy link
Contributor

cofiem commented Mar 7, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants