Read more about How ETAG works!
Search response contains etag information in etag header and in meta.versionId
. You can cache result and use If-None-Match
header or _etag
parameter to get newest data from server or response with status 304
if nothing has been changed.
GET /Patient​# respstatus: 200headers:ETag: '999'body:meta: {versionId: '999'}....​# you can cache response and versionId​# getGET /Patient?_etag=999 # laset versionIdIf-None-Match: 999​# respstatus: 304​# if etag is old you will get resultGET /Patient?_etag=99​# respstatus: 200body:meta: {versionId: '999'}​
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 do not forget update txid column and reset cache. UPDATE resource SET txid = nextval('transaction_id_seq')