You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2021. It is now read-only.
`GET /{any collection}?range={start}-{end}` | JSONArray | - responses with sub-collection extracted from the original
141
+
142
+
143
+
Implementation MUST include "Accept-Ranges: items" for collection like resources e.g. devices list. Also it MUST include "X-size" response header to indicate how many items are in the collection.
144
+
145
+
```
146
+
GET /hosts/localhost/devices
147
+
```
148
+
149
+
```
150
+
Accept-Ranges: items
151
+
X-size:26
152
+
153
+
[...]
154
+
```
155
+
156
+
**NOTE**: we can not use standard _Content-Length_ header here because it is strictly bound to bytes i.e. client may shrink incoming response hence partial JSON and JSONParse exception.
157
+
158
+
Client includes "Range" header into request to specify the desired range of the collection, while implementation MUST include "Content-Range" header:
159
+
160
+
```
161
+
GET /hosts/localhost/devices?range=10-20
162
+
```
163
+
164
+
```
165
+
HTTP 206
166
+
Content-Range: items 10-20/26
167
+
168
+
[...]
169
+
```
170
+
171
+
For instance,
172
+
```
173
+
GET /hosts/localhost/devices?range=0-25
174
+
```
175
+
176
+
will display only the first 25 devices of a particular Tango host
177
+
178
+
Implementation MUST respond with **416** in case _Range_ is not satisfiable.
179
+
180
+
# Cache
181
+
182
+
Implementation MUST provide _Cache-Control_ headers for Tango resources. Implementation MUST add _max-age-millis_ Cache-Control extension to specify cache delay in millis.
183
+
184
+
Implementation SHOULD distinguish between fast changing and slow changing values. For instance a list of available devices may be considered as slow changing value and cached for a longer time. Also slow changing values may be cached publicly.
0 commit comments