epicweb-dev / cachified

🤑 wrap virtually everything that can store by key to act as cache with ttl/max-age, stale-while-validate, parallel fetch protection and type-safety support
MIT License
916 stars 26 forks source link

swv? Shouldn't it be swr? #6

Closed kentcdodds closed 1 year ago

kentcdodds commented 2 years ago

I noticed the metadata has staleWhileRevalidate shortened to swv. Shouldn't that be swr?

Xiphe commented 1 year ago

oh, you're right. Will fix this in a backwards-compatible way within the next days.

Xiphe commented 1 year ago

Actually, the fix is a breaking change for everyone working with CacheMetadata for example by maintaining a custom Cache implementation (such as your "SQLite cache").

But the change is implemented so that existing cache entries with swv continue to work, and only new writes use swr

Xiphe commented 1 year ago

Fixed in 3.0.0

kentcdodds commented 1 year ago

Great! Thank you :)