Skip to content

Conversation

@tepinly
Copy link

@tepinly tepinly commented Jan 16, 2025

Cache refresh rate

The main idea behind the PR is to introduce cache invalidation for outdated cache by referring to :cache_refresh_period for the max duration in minutes.

  • Each hash record is stored with a cached_at element, indicating the time of caching
  • When fetching said record, we check whether the time between cached_at and that of fetching is greater than :cache_refresh_period
    • If it is, the cache is invalidated & refreshed from the database
    • If it isn't, the cache is returned normally

Implementation progress

  • Abstract the duration to a variable :cache_refresh_period
  • Implement it in single fetch
  • Implement it in multi fetch
  • Support non-hash value types
  • Add unit tests

@tepinly
Copy link
Author

tepinly commented Jan 16, 2025

I have signed the CLA!

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

Successfully merging this pull request may close these issues.

1 participant