Adding a unique version identifier to the api results (either the root, every index page, or even every result) that incremented whenever data was updated would allow developers to quickly determine if their data is stale. One request to the api root could be used to see if anything changed instead of having to walk through every page and resource to update any cached data.
Alternatively, instead of inserting version to some/all endpoints via middleware, a /version endpoint could be added for this purpose.
The example above uses a version number but it could also be a hash, uuid, datetime, or any other unique value. Something that could be calculated instead of having to be manually updated each release seems preferable. Perhaps use something like node-cache to cache a hash of the assets directory?
Adding a unique version identifier to the api results (either the root, every index page, or even every result) that incremented whenever data was updated would allow developers to quickly determine if their data is stale. One request to the api root could be used to see if anything changed instead of having to walk through every page and resource to update any cached data.
Example:
Alternatively, instead of inserting version to some/all endpoints via middleware, a /version endpoint could be added for this purpose.
The example above uses a version number but it could also be a hash, uuid, datetime, or any other unique value. Something that could be calculated instead of having to be manually updated each release seems preferable. Perhaps use something like node-cache to cache a hash of the assets directory?