As TM provides the functions of GM_setValue and GM_getValue, which we can leverage directly for cache storage in order to avoid 2nd network consuming that slows down the queries, the consideration should contain:
- Store object-oriented instances that can be reversed by serialization
- Expiration mechanism that gives the chance to the end-users to fetch the latest information
This API should be something like:
// milliseconds represents the valid period before meets the expiration date
cache.set(key, obj, milliseconds)
cache.get(key, default)