begriffs / clean_pagination

API pagination the way RFC7233 intended it
MIT License
33 stars 3 forks source link

why the status response is 206? #3

Closed nichthinkof30 closed 10 years ago

nichthinkof30 commented 10 years ago

Hi,

I'm testing your gem with angularJS, it seems very useful for me to get start as a beginner. I'm observing the behaviour right now and found out the response is 206 instead of 200? Any different? Moreover, is the data return cacheable?

Thanks :)

begriffs commented 10 years ago

The status code 206 indicates a successful but partial (paginated) result. Briefly here's what it means. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#206

You can read more about the http range requests and status codes here http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p5-range-latest.html#range.response

The response should be cacheable if you set caching headers from your server. There's an intro here https://www.mobify.com/blog/beginners-guide-to-http-cache-headers/

nichthinkof30 commented 10 years ago

@begriffs Thanks!