You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(i18n): enforce cacheMaxSize: 1 on client chunk Map
Protecting both the just-written and active keys left the Map at size 2
when max was 1. Update context before setChunk so navigation sees
keep === current, and fall back to keeping only the just-written key
when the bound still cannot hold both.
Co-authored-by: Pavel Kuzmin <Virus191288@gmail.com>
Copy file name to clipboardExpand all lines: docs/guide/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1297,7 +1297,7 @@ For most projects the default (unlimited, no expiration) is fine — route names
1297
1297
`cacheMaxSize` caps:
1298
1298
1299
1299
1.**Fetch / server `CacheControl`** (HTTP payload and server loader caches)
1300
-
2.**Client chunk Map** (`NuxtI18n.storage.translations`) — oldest unused `(locale, route)` chunks are evicted; the active page chunk is kept
1300
+
2.**Client chunk Map** (`NuxtI18n.storage.translations`) — oldest unused `(locale, route)` chunks are evicted; the just-written and active page keys are preferred. If the limit cannot hold both (e.g. `cacheMaxSize: 1`), the just-written key wins so the bound is enforced — active `$t` still uses the view layer
1301
1301
1302
1302
-**`cacheMaxSize`** — caps entries in those caches. Useful for bounding memory.
1303
1303
-**`cacheTtl`** — expires fetch/server cache entries (not the live view layer). Useful for serverless or runtime-updated translations.
Copy file name to clipboardExpand all lines: docs/news/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ outline: 'deep'
12
12
13
13
**Version**: unreleased
14
14
15
-
`i18n.cacheMaxSize` already limited fetch/server `CacheControl` caches. It now also FIFO-evicts entries in the client `NuxtI18n.storage.translations` Map (`locale:route` chunks), keeping the active page. Default `0` remains unlimited — route names from Vue Router are finite, so this is an optional bound for long SPA sessions with many page dictionaries.
15
+
`i18n.cacheMaxSize` already limited fetch/server `CacheControl` caches. It now also FIFO-evicts entries in the client `NuxtI18n.storage.translations` Map (`locale:route` chunks), preferring the active and just-written keys. When the limit cannot hold both (e.g. `1`), the just-written key wins so the bound is enforced. Default `0` remains unlimited — route names from Vue Router are finite, so this is an optional bound for long SPA sessions with many page dictionaries.
16
16
17
17
## Nuxt I18n Micro v3.26.1 — Vue DevTools live inspector
0 commit comments