Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster retrieving with cache mechanism #6

Open
caryyu opened this issue Apr 30, 2021 · 0 comments
Open

Faster retrieving with cache mechanism #6

caryyu opened this issue Apr 30, 2021 · 0 comments

Comments

@caryyu
Copy link
Owner

caryyu commented Apr 30, 2021

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant