# Type-Safe Caching in Encore.ts

DevFeed: [Type-Safe Caching in Encore.ts](<https://devfeed.tech/articles/type-safe-caching-in-encore-ts-17857.md>)

Original publisher: [Read original article](<https://encore.dev/blog/type-safe-caching>)

Author: Ivan Cernja

Published: 2026-03-11T00:00:00Z

Content type: article

Language: en

Sources: [Encore Updates](<https://devfeed.tech/sources/encore-updates.md>)

Topics: [Caching](<https://devfeed.tech/topics/caching.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [backends](<https://devfeed.tech/topics/backends.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [redis](<https://devfeed.tech/tags/redis.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

This article explains how string-based Redis caching in TypeScript can lose type safety and allow stale, colliding, or mismatched values. It presents Encore.ts v1.55's typed keyspaces, which preserve value and key constraints through to Redis and catch certain errors at compile time.

## Source excerpt

What goes wrong with stringly-typed Redis, and what changes when the cache boundary is typed.