ETAG support
Read more about How ETAG works!

Search API & ETAG

Search response contains etag information in the etag header and in meta.versionId. You can cache result and use If-None-Match header or _etag parameter to get the latest data from the server or a response with 304 if nothing has been changed.
1
GET /Patient
2
Accept: text/yaml
3
4
# resp
5
status: 200
6
headers:
7
ETag: '999'
8
body:
9
meta: {versionId: '999'}
10
....
11
12
# you can cache response and versionId
13
14
# get
15
GET /Patient?_etag=999 # laset versionId
16
Accept: text/yaml
17
If-None-Match: 999
18
19
# resp
20
status: 304
21
22
# if etag is old you will get result
23
GET /Patient?_etag=99
24
Accept: text/yaml
25
26
# resp
27
status: 200
28
body:
29
meta: {versionId: '999'}
30
Copied!

ETag Cache

All ETag values are cached to make ETag queries efficient. If you somehow made this cache invalid, you can reset Aidbox ETag cache by DELETE /$etags-cache or DELETE /Patient/$etags-cache.
Aidbox ETags machine is based on txid column in database! If you update resources in database, don't forget to update the txid column and reset cache. UPDATE resource SET txid = nextval('transaction_id_seq')