Menu

1 / 2

Layercache 2.0.0: Millisecond TTLs, Stale-Preserving Expiration, and Better Redis Coverage

DEV Community·날다람쥐·7 months ago
#5LXmw9Jo
#node#typescript#redis#opensource#cache
Reading 0:00
15s threshold

Layercache 2.0.0 is out.

This release is intentionally a major version because it changes the public TTL semantics from seconds to milliseconds. That is a breaking change, but it also makes Layercache much more consistent with Node.js timers, Redis PX / PTTL , and most JavaScript runtime APIs.

What changed?

Breaking: TTL values are now milliseconds

Before 2.0.0 , TTL examples and parts of the public API used seconds.

In 2.0.0 , TTL-related values are consistently milliseconds:

const cache = new CacheStack ({ layers : [ memory , redis ], ttl : 60 _000 })

await cache .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.