Closed assensamuelsson closed 10 months ago
The problem is Infinity doesn't serialize as a number. I would recommend just setting it to a very high number (like Number.MAX_SAFE_INTEGER
) which is hundreds of thousands of years ago it should be enough.
I think I prefer that solution over coming up with our own serialization solution.
Hope that helps! If you'd like to make a contribution to the docs about this, I welcome it 😁
We have written our own adapter for ioredis and took inspiration from the official redis adapters provided in this repo.
Our use case is that we want to set
swr
toInfinity
so that all keys should be stored in Redis forever and basically be updated in the background by cachified. The official repos does not seem to takeswr
into account when determining if the key in Redis should expire or not and we're wondering if there is a bug here or if there is something we're missing?I'm providing a failing test case in a Pull Request to demonstrate my point. https://github.com/epicweb-dev/cachified/pull/85