@trieb.work/nextjs-turbo-redis-cache 1.7.1 → 1.8.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -101
- package/README.md +20 -15
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +399 -267
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +399 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/RedisStringsHandler.ts +522 -358
- package/src/SyncedMap.ts +11 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,185 +1,180 @@
|
|
|
1
|
-
|
|
1
|
+
# [1.8.0-beta.2](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.8.0-beta.1...v1.8.0-beta.2) (2025-06-11)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
* revalidate times from data parameter for fetch entries ([e48f0d1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e48f0d19b81b65ae2564453fd75251372080407e))
|
|
8
|
-
* revalidate times from data parameter for fetch entries ([3c38335](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3c3833561863ec4f07252ba7b9b30b42518b7485))
|
|
6
|
+
* remove connect timeout ([4dceda1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/4dceda15a0ae8ca3c5fcdddf861263ef7ca237ce))
|
|
9
7
|
|
|
10
|
-
# [1.
|
|
8
|
+
# [1.8.0-beta.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.7.1...v1.8.0-beta.1) (2025-06-10)
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
### Features
|
|
14
12
|
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
# [1.6.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.1...v1.6.0) (2025-05-26)
|
|
13
|
+
* improve error handling ([dd591da](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dd591daab9539e6ba96da1d1c493a1e771ba272d))
|
|
18
14
|
|
|
15
|
+
## [1.7.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.7.0...v1.7.1) (2025-06-10)
|
|
19
16
|
|
|
20
17
|
### Bug Fixes
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* readme ([2901ab0](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2901ab0e0d646839e1779107aa9bea80deacf6c8))
|
|
26
|
-
* readme test startup ([e291666](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e291666ed7b9d77c0f3baa68c3638bbad264a868))
|
|
27
|
-
* rename redis_url to redisUrl to align with other config option naming convention + fix: readme ([2e3f20d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2e3f20dce31a678b781913d230581461b3d67a07))
|
|
19
|
+
- revalidate times for fetch entries from context is outdated ([4538f9f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/4538f9f8bf58b97727e83f2026929db11be470ec))
|
|
20
|
+
- revalidate times from data parameter for fetch entries ([e48f0d1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e48f0d19b81b65ae2564453fd75251372080407e))
|
|
21
|
+
- revalidate times from data parameter for fetch entries ([3c38335](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3c3833561863ec4f07252ba7b9b30b42518b7485))
|
|
28
22
|
|
|
23
|
+
# [1.7.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.6.0...v1.7.0) (2025-05-26)
|
|
29
24
|
|
|
30
25
|
### Features
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## [1.5.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.0...v1.5.1) (2025-05-23)
|
|
27
|
+
- add TLS/SSL support with Redis client configuration options ([9f80dd6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9f80dd6b53659ea488af6948a9c952ce0cda7490))
|
|
35
28
|
|
|
29
|
+
# [1.6.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.1...v1.6.0) (2025-05-26)
|
|
36
30
|
|
|
37
31
|
### Bug Fixes
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
- config ([d326ef4](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d326ef46298a96535720f78d562a20b27e7b3c8f))
|
|
34
|
+
- config ([311d492](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/311d492c41d8c05b89d675753d79413632fc0019))
|
|
35
|
+
- process.env.redisUrl ([a57fd6a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/a57fd6a6b641015726edf11a00fa5c020dea0cca))
|
|
36
|
+
- readme ([2901ab0](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2901ab0e0d646839e1779107aa9bea80deacf6c8))
|
|
37
|
+
- readme test startup ([e291666](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e291666ed7b9d77c0f3baa68c3638bbad264a868))
|
|
38
|
+
- rename redis_url to redisUrl to align with other config option naming convention + fix: readme ([2e3f20d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2e3f20dce31a678b781913d230581461b3d67a07))
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
### Features
|
|
42
41
|
|
|
42
|
+
- disable keyspace config check ([0b8878d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/0b8878d321808d00140664f51fc1d2d904cc4664))
|
|
43
|
+
|
|
44
|
+
## [1.5.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.0...v1.5.1) (2025-05-23)
|
|
43
45
|
|
|
44
46
|
### Bug Fixes
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
- Update package.json ([63e6ffd](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/63e6ffdc21032cfb1c5ecb507276fd832ee8252a))
|
|
47
49
|
|
|
50
|
+
# [1.5.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.4.0...v1.5.0) (2025-05-16)
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
- improving log fitting the new redis url option ([59b7e59](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/59b7e5921c724ceff58917d712e310b18a23b464))
|
|
48
55
|
|
|
49
56
|
### Features
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
- add redis_url param ([cea59a1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cea59a10f0f2e1b73b8005683ea65f22ba95edc7))
|
|
52
59
|
|
|
53
60
|
# [1.4.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.3.0...v1.4.0) (2025-05-09)
|
|
54
61
|
|
|
55
|
-
|
|
56
62
|
### Bug Fixes
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
- add tests ([225fc49](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/225fc49eff26d631c4b8d50a15ef2c864213f36b))
|
|
65
|
+
- comment ([321ddec](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/321ddec4ee9b6a6e2cf1f78062d05d2cc7b45e4c))
|
|
66
|
+
- remove retry ([ca4ff6c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/ca4ff6c4072e675da42dbcfe36d3ff422dc54f12))
|
|
67
|
+
- remove retry ([3a1cf7d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3a1cf7dc5fd315ff3c84460052af20b8e40014ec))
|
|
68
|
+
- remove retry ([207413b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/207413b81cb51143e04dff9a2310a185d6bba568))
|
|
69
|
+
- tests and ci ([b0841ad](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/b0841ad9bc2c4b3ab9edde7047259cd45fbd5f02))
|
|
65
70
|
|
|
66
71
|
### Features
|
|
67
72
|
|
|
68
|
-
|
|
73
|
+
- add support for nextjs 15.3.2 ([fcd8bb5](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fcd8bb5469bbefcd88397d3ef86ce3eb0fee7c02))
|
|
69
74
|
|
|
70
75
|
# [1.3.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.2.1...v1.3.0) (2025-05-08)
|
|
71
76
|
|
|
72
|
-
|
|
73
77
|
### Bug Fixes
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
- encoding of data in cache entry ([9f0e747](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9f0e747b224294905427ba3060185f68fee16f0f))
|
|
80
|
+
- escape characte ([dbd9141](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dbd91413b777b2a4554597f3ca2b7f1de1163a80))
|
|
81
|
+
- readme ([31dcaa4](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/31dcaa40ac19ea42a7f4d6ca33e4642704ad1f6b))
|
|
82
|
+
- readme ([dfb69c8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dfb69c861ddaa4a94411d419854e1c2e1e99152e))
|
|
83
|
+
- test ([13b2cb8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/13b2cb8020ef7457473b208675bf3fce4161f492))
|
|
84
|
+
- tests ([02357e1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/02357e1a7a29d997c95dce42399fef26530467d4))
|
|
85
|
+
- tests ([a5587dc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/a5587dc3701a92069da945f548991aeb0d999285))
|
|
86
|
+
- tests + re-add old implementation ([cb6d36d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cb6d36d46008d422b4396fd580d35fa97848edb7))
|
|
87
|
+
- tests improvement ([73a3594](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/73a35946cfcd5e4811c2c09201bb02c9cdea5298))
|
|
88
|
+
- tests, make them independent from each other ([35885e3](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/35885e38a58ac0aa976c86dd964549e2d3426a79))
|
|
86
89
|
|
|
87
90
|
### Features
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
92
|
+
- add files ([d8a2474](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d8a24747a6a2a12e2709d017dd36c7b80b2ad49f))
|
|
93
|
+
- add more comments ([fb2f105](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fb2f10588566fad042d2e8da4999cf7bf591555d))
|
|
94
|
+
- add new invalidation logic for fetch requests + new tests ([9d0d1d2](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9d0d1d2eafb785dbe91b172358a19494c623cc68))
|
|
95
|
+
- add new tests ([836b882](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/836b88249365ea8745ca839a7dc3a3a4a77732e6))
|
|
96
|
+
- add new tests ([d0e6833](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d0e68335ce13827f74ed1be5b115f7351beebd47))
|
|
97
|
+
- adding a test page ([d4c8a8c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d4c8a8caaba7f4e5003606860babd9e50c6ed99a))
|
|
98
|
+
- adding comfortable cache testing tool on homepage ([340d5cb](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/340d5cbc929ea8dcdbef2a949e1656d014d1f3bb))
|
|
99
|
+
- adding nextjs unit tests ([368ec75](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/368ec755a8532a52526e3364cc02f64b7d4245fa))
|
|
100
|
+
- changed ([8501a4e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/8501a4ee963975f32661789e31281785cf01519a))
|
|
101
|
+
- changed hook ([92f9d3c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/92f9d3c4b8d9afd6bbbb9cc3a69138823f4d4f87))
|
|
102
|
+
- changed hook ([6b32f0a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/6b32f0abcda935046e61242ba633728bcf23a460))
|
|
103
|
+
- extend and fix caching + chore: update readme ([7ef38a8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7ef38a8ed2a20957cc78ffa213be3cb334736b19))
|
|
104
|
+
- extend tests ([db9bb85](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/db9bb85e398a7d6e1ba522b990de7e5e241b54b6))
|
|
105
|
+
- improve flaky ms sync delay ([6655884](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/665588474a09f1eb4f4683d2e107ec8b5b36b39a))
|
|
106
|
+
- improve readme ([926493a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/926493a198d15e32e5e4b5c619375df85c646f1c))
|
|
107
|
+
- improve tests ([3fcfadf](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3fcfadf49389fe8a7218417fb79ec74445e76cb7))
|
|
108
|
+
- remove unnecessary revalidatedTagsMap ([7b5c313](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7b5c313e91b5157f113085be75dceba8013c0e81))
|
|
109
|
+
- test is running ([6091471](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/6091471a12f954e3da4bd94db0929b0bd2cfd701))
|
|
110
|
+
- tests ([bd6904e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/bd6904e94a43cfac183a5ec86cbbea0f4e40a816))
|
|
111
|
+
- tests 2 ([974c952](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/974c952587a9d330934f49b26db84c037b3695f5))
|
|
112
|
+
- update CI with pnpm ([c1b0b33](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/c1b0b33417b416bd7755b6b2f43d0b9bea5c7690))
|
|
113
|
+
- update CI with pnpm ([d850377](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d85037706876dcb036bb6f952a48937c3e96cba3))
|
|
114
|
+
- update CI with pnpm 10 ([c559936](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/c5599361f15c4c82fa999e16a48fcf78e53355a6))
|
|
115
|
+
- update CI with pnpm 11 ([f83708f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/f83708f76c3924b8b80dd612965dc49a95d7e18c))
|
|
116
|
+
- update CI with pnpm 2 ([235f0fc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/235f0fc8cb35dbe532091d8f545791b8dd05b6be))
|
|
117
|
+
- update CI with pnpm 2 ([cb9624e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cb9624e900f555bc07c734ff152c4f4a93000e54))
|
|
118
|
+
- update CI with pnpm 3 ([72c25ce](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/72c25cefa2aea6767d5a71b5470955a18f9036b9))
|
|
119
|
+
- update CI with pnpm 4 ([fff355a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fff355a8e047d766121d255881d891fa7c5a754e))
|
|
120
|
+
- update CI with pnpm 4 ([facd58b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/facd58bdefd530d70fdbb2f7d48c9962ca2195e5))
|
|
121
|
+
- update CI with pnpm 5 ([03d9d90](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/03d9d906e852927496a58504dd9c7448e31878a1))
|
|
122
|
+
- update CI with pnpm 6 ([b5e7066](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/b5e7066ec840edfa7d6df6c6ab978c61b356c8b5))
|
|
123
|
+
- update CI with pnpm 8 ([20c3a5b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/20c3a5be9d465537240cce6ac5346554667cda68))
|
|
124
|
+
- update CI with pnpm 9 ([5160fd3](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/5160fd3e1a010a5b52b99d0e2e0de3b9035d1e88))
|
|
125
|
+
- update docs and tests ([7a46c21](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7a46c21346d878df88283071551f06a34d71eb9a))
|
|
123
126
|
|
|
124
127
|
## [1.2.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.2.0...v1.2.1) (2025-03-28)
|
|
125
128
|
|
|
126
|
-
|
|
127
129
|
### Bug Fixes
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
- imports ([41f0cf9](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/41f0cf97506c134f8dfb37fab746cc9c066c515f))
|
|
130
132
|
|
|
131
133
|
# [1.2.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.3...v1.2.0) (2025-03-28)
|
|
132
134
|
|
|
133
|
-
|
|
134
135
|
### Features
|
|
135
136
|
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
- add tsup ([ccf122a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/ccf122a243fade016b6b2d544acec4098222becd))
|
|
138
|
+
- add tsup ([2dffad6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2dffad68401bc273cf81a0a0d06446d34b574a5e))
|
|
138
139
|
|
|
139
140
|
## [1.1.3](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.2...v1.1.3) (2025-03-28)
|
|
140
141
|
|
|
141
|
-
|
|
142
142
|
### Bug Fixes
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
- Update README.md ([0a79274](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/0a79274e363856f07b1dce62ec74b54ad92a946e))
|
|
145
145
|
|
|
146
146
|
## [1.1.2](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.1...v1.1.2) (2025-03-28)
|
|
147
147
|
|
|
148
|
-
|
|
149
148
|
### Bug Fixes
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
- Update package.json ([3775c36](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3775c36f3c110686856f8644315ca6e02a3c483f))
|
|
152
151
|
|
|
153
152
|
## [1.1.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.0...v1.1.1) (2025-03-28)
|
|
154
153
|
|
|
155
|
-
|
|
156
154
|
### Bug Fixes
|
|
157
155
|
|
|
158
|
-
|
|
156
|
+
- Update package.json ([bf17b41](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/bf17b4186c8b7d94be83c61b5d4f8622ac7cf7f0))
|
|
159
157
|
|
|
160
158
|
# [1.1.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.0.0...v1.1.0) (2025-03-28)
|
|
161
159
|
|
|
162
|
-
|
|
163
160
|
### Features
|
|
164
161
|
|
|
165
|
-
|
|
162
|
+
- Update README.md ([10b474b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/10b474b456803be924bf4170b6cda662827202c4))
|
|
166
163
|
|
|
167
164
|
# 1.0.0 (2025-03-28)
|
|
168
165
|
|
|
169
|
-
|
|
170
166
|
### Bug Fixes
|
|
171
167
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
168
|
+
- double sync on key expiration ([14afef6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/14afef6b08e3399a2aa7d6cf42a4b9b7b5ea5d33))
|
|
169
|
+
- lint errors ([2b9b138](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2b9b138759f5754577205b58a998cc034b3b0db5))
|
|
170
|
+
- rEADME ([9e4fab1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9e4fab163002c34e8077285064c24ee05ba92bac))
|
|
176
171
|
|
|
177
172
|
### Features
|
|
178
173
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
174
|
+
- add handler code ([72251f5](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/72251f58446ec6fb3819ea0bdd67fc012e8a5c38))
|
|
175
|
+
- add handler code ([f674f26](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/f674f262f292e47fd228a827590e8dc10391e5cb))
|
|
176
|
+
- add handler code ([24c497f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/24c497f1d67898e64528105c61a90b00f55ba02a))
|
|
177
|
+
- improve readme and remove logs ([79408fb](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/79408fbd488db11fcc7472b690f1fff237816da8))
|
|
178
|
+
- improve readme and remove logs ([de7a6aa](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/de7a6aa735d6295299d3a5d41d0fd00d64ac6f89))
|
|
179
|
+
- rename package and extend readme ([e16bcdc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e16bcdc6329ee913e1794f2bce05e1e88a08d91b))
|
|
180
|
+
- update to next 15 types + feat: add delete sync to deduplication cache ([832c28f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/832c28f1fe0831b87790c2d60e33b314be0adf58))
|
package/README.md
CHANGED
|
@@ -50,6 +50,10 @@ Furthermore there exists the DEBUG_CACHE_HANDLER environment variable to enable
|
|
|
50
50
|
|
|
51
51
|
There exists also the SKIP_KEYSPACE_CONFIG_CHECK environment variable to skip the check for the keyspace configuration. This is useful if you are using redis in a cloud environment that forbids access to config commands. If you set SKIP_KEYSPACE_CONFIG_CHECK=true the check will be skipped and the keyspace configuration will be assumed to be correct (e.g. notify-keyspace-events Exe).
|
|
52
52
|
|
|
53
|
+
KILL_CONTAINER_ON_ERROR_THRESHOLD: Optional environment variable that defines how many Redis client errors should occur before the process exits with code 1. This is useful in container environments like Kubernetes where you want the container to restart if Redis connectivity issues persist. Set to 0 (default) to disable this feature. For example, setting KILL_CONTAINER_ON_ERROR_THRESHOLD=10 will exit the process after 10 Redis client errors, allowing the container orchestrator to restart the container.
|
|
54
|
+
|
|
55
|
+
REDIS_COMMAND_TIMEOUT_MS: Optional environment variable that sets the timeout in milliseconds for Redis commands. If not set, defaults to 5000ms (5 seconds). The value is parsed as an integer, and if parsing fails, falls back to the 5000ms default.
|
|
56
|
+
|
|
53
57
|
### Option A: minimum implementation with default options
|
|
54
58
|
|
|
55
59
|
extend `next.config.js` with:
|
|
@@ -119,21 +123,22 @@ A working example of above can be found in the `test/integration/next-app-custom
|
|
|
119
123
|
|
|
120
124
|
## Available Options
|
|
121
125
|
|
|
122
|
-
| Option
|
|
123
|
-
|
|
|
124
|
-
| redisUrl
|
|
125
|
-
| database
|
|
126
|
-
| keyPrefix
|
|
127
|
-
| sharedTagsKey
|
|
128
|
-
| timeoutMs
|
|
129
|
-
| revalidateTagQuerySize
|
|
130
|
-
| avgResyncIntervalMs
|
|
131
|
-
| redisGetDeduplication
|
|
132
|
-
| inMemoryCachingTime
|
|
133
|
-
| defaultStaleAge
|
|
134
|
-
| estimateExpireAge
|
|
135
|
-
| socketOptions
|
|
136
|
-
| clientOptions
|
|
126
|
+
| Option | Description | Default Value |
|
|
127
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| redisUrl | Redis connection url | `process.env.REDIS_URL? process.env.REDIS_URL : process.env.REDISHOST ? redis://${process.env.REDISHOST}:${process.env.REDISPORT} : 'redis://localhost:6379'` |
|
|
129
|
+
| database | Redis database number to use. Uses DB 0 for production, DB 1 otherwise | `process.env.VERCEL_ENV === 'production' ? 0 : 1` |
|
|
130
|
+
| keyPrefix | Prefix added to all Redis keys | `process.env.VERCEL_URL \|\| 'UNDEFINED_URL_'` |
|
|
131
|
+
| sharedTagsKey | Key used to store shared tags hash map in Redis | `'__sharedTags__'` |
|
|
132
|
+
| timeoutMs | Timeout in milliseconds for Redis operations | `Number.parseInt(process.env.REDIS_COMMAND_TIMEOUT_MS) ?? 5_000 : 5_000` |
|
|
133
|
+
| revalidateTagQuerySize | Number of entries to query in one batch during full sync of shared tags hash map | `250` |
|
|
134
|
+
| avgResyncIntervalMs | Average interval in milliseconds between tag map full re-syncs | `3600000` (1 hour) |
|
|
135
|
+
| redisGetDeduplication | Enable deduplication of Redis get requests via internal in-memory cache. | `true` |
|
|
136
|
+
| inMemoryCachingTime | Time in milliseconds to cache Redis get results in memory. Set this to 0 to disable in-memory caching completely. | `10000` |
|
|
137
|
+
| defaultStaleAge | Default stale age in seconds for cached items | `1209600` (14 days) |
|
|
138
|
+
| estimateExpireAge | Function to calculate expire age (redis TTL value) from stale age | Production: `staleAge * 2`<br> Other: `staleAge * 1.2` |
|
|
139
|
+
| socketOptions | Redis client socket options for TLS/SSL configuration (e.g., `{ tls: true, rejectUnauthorized: false }`) | `{ connectTimeout: timeoutMs }` |
|
|
140
|
+
| clientOptions | Additional Redis client options (e.g., username, password) | `undefined` |
|
|
141
|
+
| killContainerOnErrorThreshold | Number of consecutive errors before the container is killed. Set to 0 to disable. | `Number.parseInt(process.env.KILL_CONTAINER_ON_ERROR_THRESHOLD) ?? 0 : 0` |
|
|
137
142
|
|
|
138
143
|
## TLS Configuration
|
|
139
144
|
|
package/dist/index.d.mts
CHANGED
|
@@ -52,6 +52,10 @@ type CreateRedisStringsHandlerOptions = {
|
|
|
52
52
|
* @default Production: staleAge * 2, Other: staleAge * 1.2
|
|
53
53
|
*/
|
|
54
54
|
estimateExpireAge?: (staleAge: number) => number;
|
|
55
|
+
/** Kill container on Redis client error if error threshold is reached
|
|
56
|
+
* @default 0 (0 means no error threshold)
|
|
57
|
+
*/
|
|
58
|
+
killContainerOnErrorThreshold?: number;
|
|
55
59
|
/** Additional Redis client socket options
|
|
56
60
|
* @example { tls: true, rejectUnauthorized: false }
|
|
57
61
|
*/
|
|
@@ -75,8 +79,10 @@ declare class RedisStringsHandler {
|
|
|
75
79
|
private inMemoryCachingTime;
|
|
76
80
|
private defaultStaleAge;
|
|
77
81
|
private estimateExpireAge;
|
|
78
|
-
|
|
82
|
+
private killContainerOnErrorThreshold;
|
|
83
|
+
constructor({ redisUrl, database, keyPrefix, sharedTagsKey, timeoutMs, revalidateTagQuerySize, avgResyncIntervalMs, redisGetDeduplication, inMemoryCachingTime, defaultStaleAge, estimateExpireAge, killContainerOnErrorThreshold, socketOptions, clientOptions, }: CreateRedisStringsHandlerOptions);
|
|
79
84
|
resetRequestCache(): void;
|
|
85
|
+
private clientReadyCalls;
|
|
80
86
|
private assertClientIsReady;
|
|
81
87
|
get(key: string, ctx: {
|
|
82
88
|
kind: 'APP_ROUTE' | 'APP_PAGE';
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,10 @@ type CreateRedisStringsHandlerOptions = {
|
|
|
52
52
|
* @default Production: staleAge * 2, Other: staleAge * 1.2
|
|
53
53
|
*/
|
|
54
54
|
estimateExpireAge?: (staleAge: number) => number;
|
|
55
|
+
/** Kill container on Redis client error if error threshold is reached
|
|
56
|
+
* @default 0 (0 means no error threshold)
|
|
57
|
+
*/
|
|
58
|
+
killContainerOnErrorThreshold?: number;
|
|
55
59
|
/** Additional Redis client socket options
|
|
56
60
|
* @example { tls: true, rejectUnauthorized: false }
|
|
57
61
|
*/
|
|
@@ -75,8 +79,10 @@ declare class RedisStringsHandler {
|
|
|
75
79
|
private inMemoryCachingTime;
|
|
76
80
|
private defaultStaleAge;
|
|
77
81
|
private estimateExpireAge;
|
|
78
|
-
|
|
82
|
+
private killContainerOnErrorThreshold;
|
|
83
|
+
constructor({ redisUrl, database, keyPrefix, sharedTagsKey, timeoutMs, revalidateTagQuerySize, avgResyncIntervalMs, redisGetDeduplication, inMemoryCachingTime, defaultStaleAge, estimateExpireAge, killContainerOnErrorThreshold, socketOptions, clientOptions, }: CreateRedisStringsHandlerOptions);
|
|
79
84
|
resetRequestCache(): void;
|
|
85
|
+
private clientReadyCalls;
|
|
80
86
|
private assertClientIsReady;
|
|
81
87
|
get(key: string, ctx: {
|
|
82
88
|
kind: 'APP_ROUTE' | 'APP_PAGE';
|