Skip to content

Conversation

thomaspaulmann
Copy link
Member

Adding a new utility function that helps wrapping expensive functions like long-running API calls insie a cache function. Few gimmicks:

  1. Have some TTL that invalidates the cache
  2. Hash the function to easily use the cache without specifying a key
  3. Add some validate function to allow invalidating the cache. This is handy when you want to search a list first with cached results but then do some network call in case something wasn't found in the cached results.

@mathieudutour mathieudutour merged commit 847c72a into main Feb 28, 2025
1 check passed
@mathieudutour mathieudutour deleted the with-cache branch February 28, 2025 10:57
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.

2 participants