@upstash/redis
Advanced
Disable automatic serialization
Your data is (de)serialized as json
by default. This works for most use cases
but you can disable it if you want:
This probably breaks quite a few types, but it’s a first step in that direction. Please report bugs and broken types here.
keepalive
@upstash/redis
is capable of reusing connections where possible to minimize
latency. Connections can be reused if the client is stored in memory and not
initialized with every new function invocation. The easiest way to achieve this
is by creating the client outside of your handler and adding an https agent:
Whenever your hot lambda receives a new request the client is already initialized and the previously established connection to upstash is reused.