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.

GET /Patient
Accept: text/yaml
# resp
status: 200
headers:
ETag: '999'
body:
meta: {versionId: '999'}
....
# you can cache response and versionId
# get
GET /Patient?_etag=999 # laset versionId
Accept: text/yaml
If-None-Match: 999
# resp
status: 304
# if etag is old you will get result
GET /Patient?_etag=99
Accept: text/yaml
# resp
status: 200
body:
meta: {versionId: '999'}

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')