Caching and compression
Compression
Send Accept-Encoding: gzip on every request.
/yachts/{id}is stored compressed. WithAccept-Encoding: gzipyou receive it as it is stored, withContent-Encoding: gzip. Without it, the API decompresses it for you.- The lists are compressed when you accept gzip and the body is about 1 KB or larger. A full list is much larger than that.
Most HTTP clients decompress for you when you enable it, for example curl --compressed.
ETag and If-None-Match
/yachts/{id} answers with a weak entity tag:
ETag: W/"5d41402abc4b2a76b9719d911017c592d41402abc4b2a76b9719d911017c592"
Store it with the record. Next time, send it back:
If-None-Match: W/"5d41402abc4b2a76b9719d911017c592d41402abc4b2a76b9719d911017c592"
- If the record has not changed, the API answers
304 Not Modifiedwith no body. Keep your copy. - If it has changed, you get
200with the new record and a newETag.
The tag is the same whether the body was compressed or not, and the W/ prefix is optional in
If-None-Match. The lists and find endpoints carry no ETag.
Cache headers
Every response has Cache-Control: private and Vary: Accept-Encoding. The data is licensed to
your key: do not put it in a shared or public cache.
How often data changes
Changes in the SuperYacht Times database reach the API within about ten minutes. A sync every ten minutes or less often is enough; most partners sync hourly or daily.