Migration from expiresAt to fetchedAt (optimistic results)
TL;DR
data considered as fresh when it's not older than
was: 5 minutes
now: 1 minute
stale data handling:
was: completely removed from cache and never returned from API
now: returned from API even if it's stale, but fetching of new data initiated immediately
was: all items in data array had
expiresAt
field that indicated when server will consider data as stale and will refresh it from blockchain. After that you could re-request fresh data.now: all items in data array have
fetchedAt
field that indicates when server received data from blockchain. Once 1 minute since it transpires, you can consider data as stale and re-request it.
Why: data mappings change rarely. Results from hour ago and even from week ago will 99% be accurate. So we return stale from API just to provide a fast initial response, but at the same time we trigger refresh of our caches and when you re-request data in second or two, data will be absolitutely fresh. BUT these second or two really matter when it comes to UX.
Async endpoints
In async version of API now you will immediately receive last fetched bindings for requested domain/address. If some bindings are aged more than 1 minute, system will begin automatic data updating. After ~2-3 sec from first request you can rerequest data and obtain fresh bindings. About completness and processedVendors - previously was linked with data field and represented from how many and from what vendors data are included in response. Now to fit optimistic results concept completness
and processedVendors
only include vendors with data aged max 1 minute.
It means if you request data from following vendors: ens, lens and sid, the response will looks like this (the new approach):
Please note that completeness
is not 1, this means that some data is too old and can be used only for “readonly” mode and now our system is already updating data from corresponding vendors. You can evaluate fetchedAt
field to see which records are actually outdated – the value will be older than 1 minute ago. Now see example of response for same request and same context of data fresness, but from expiresAt
concept (the old approach):
Sync endpoints
Previously you received fullfilled response (means with data from all requested vendors) with data aged max 5 minutes. Now data is aged max to 1 minute.
Last updated