nitro icon indicating copy to clipboard operation
nitro copied to clipboard

feat(cache): set `ttl` for native expiration

Open pi0 opened this issue 1 year ago โ€ข 0 comments

๐Ÿ”— Linked issue

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [ ] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

This change, adds ttl (in seconds) as transaction options to the underlying unstorage driver with .setItem so in case it has native invalidation support (currently, redis, cloudflare*, vercel-kv support it) so the cache entries are automatically evicted.

๐Ÿ“ Checklist

  • [ ] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

pi0 avatar Oct 10 '24 10:10 pi0