Add CacheHandler and CacheEntry types to next/cache
Custom cache handler authors currently import CacheHandler and CacheEntry from next/dist/server/lib/cache-handlers/types (an internal path that can move between versions) or hand-copy the interfaces, which drift silently across releases.
The docs even link to the source file on GitHub as the type reference.
Export them as types from the existing next/cache surface, so handlers can be checked against the real interface:
```typescript
import type { CacheHandler } from 'next/cache'
```
Raised in discussion #96356.
Showing
Please
register
or
sign in
to comment