@trieb.work/nextjs-turbo-redis-cache 1.7.1 → 1.8.0-beta.1
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 +89 -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 +524 -358
- package/src/SyncedMap.ts +11 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,185 +1,173 @@
|
|
|
1
|
-
|
|
1
|
+
# [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)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* improve error handling ([dd591da](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dd591daab9539e6ba96da1d1c493a1e771ba272d))
|
|
2
7
|
|
|
8
|
+
## [1.7.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.7.0...v1.7.1) (2025-06-10)
|
|
3
9
|
|
|
4
10
|
### Bug Fixes
|
|
5
11
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
- revalidate times for fetch entries from context is outdated ([4538f9f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/4538f9f8bf58b97727e83f2026929db11be470ec))
|
|
13
|
+
- revalidate times from data parameter for fetch entries ([e48f0d1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e48f0d19b81b65ae2564453fd75251372080407e))
|
|
14
|
+
- revalidate times from data parameter for fetch entries ([3c38335](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3c3833561863ec4f07252ba7b9b30b42518b7485))
|
|
9
15
|
|
|
10
16
|
# [1.7.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.6.0...v1.7.0) (2025-05-26)
|
|
11
17
|
|
|
12
|
-
|
|
13
18
|
### Features
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
- add TLS/SSL support with Redis client configuration options ([9f80dd6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9f80dd6b53659ea488af6948a9c952ce0cda7490))
|
|
16
21
|
|
|
17
22
|
# [1.6.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.1...v1.6.0) (2025-05-26)
|
|
18
23
|
|
|
19
|
-
|
|
20
24
|
### Bug Fixes
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- config ([d326ef4](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d326ef46298a96535720f78d562a20b27e7b3c8f))
|
|
27
|
+
- config ([311d492](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/311d492c41d8c05b89d675753d79413632fc0019))
|
|
28
|
+
- process.env.redisUrl ([a57fd6a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/a57fd6a6b641015726edf11a00fa5c020dea0cca))
|
|
29
|
+
- readme ([2901ab0](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2901ab0e0d646839e1779107aa9bea80deacf6c8))
|
|
30
|
+
- readme test startup ([e291666](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e291666ed7b9d77c0f3baa68c3638bbad264a868))
|
|
31
|
+
- 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))
|
|
29
32
|
|
|
30
33
|
### Features
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
- disable keyspace config check ([0b8878d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/0b8878d321808d00140664f51fc1d2d904cc4664))
|
|
33
36
|
|
|
34
37
|
## [1.5.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.5.0...v1.5.1) (2025-05-23)
|
|
35
38
|
|
|
36
|
-
|
|
37
39
|
### Bug Fixes
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
- Update package.json ([63e6ffd](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/63e6ffdc21032cfb1c5ecb507276fd832ee8252a))
|
|
40
42
|
|
|
41
43
|
# [1.5.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.4.0...v1.5.0) (2025-05-16)
|
|
42
44
|
|
|
43
|
-
|
|
44
45
|
### Bug Fixes
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
- improving log fitting the new redis url option ([59b7e59](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/59b7e5921c724ceff58917d712e310b18a23b464))
|
|
48
48
|
|
|
49
49
|
### Features
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
- add redis_url param ([cea59a1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cea59a10f0f2e1b73b8005683ea65f22ba95edc7))
|
|
52
52
|
|
|
53
53
|
# [1.4.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.3.0...v1.4.0) (2025-05-09)
|
|
54
54
|
|
|
55
|
-
|
|
56
55
|
### Bug Fixes
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
- add tests ([225fc49](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/225fc49eff26d631c4b8d50a15ef2c864213f36b))
|
|
58
|
+
- comment ([321ddec](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/321ddec4ee9b6a6e2cf1f78062d05d2cc7b45e4c))
|
|
59
|
+
- remove retry ([ca4ff6c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/ca4ff6c4072e675da42dbcfe36d3ff422dc54f12))
|
|
60
|
+
- remove retry ([3a1cf7d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3a1cf7dc5fd315ff3c84460052af20b8e40014ec))
|
|
61
|
+
- remove retry ([207413b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/207413b81cb51143e04dff9a2310a185d6bba568))
|
|
62
|
+
- tests and ci ([b0841ad](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/b0841ad9bc2c4b3ab9edde7047259cd45fbd5f02))
|
|
65
63
|
|
|
66
64
|
### Features
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
- add support for nextjs 15.3.2 ([fcd8bb5](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fcd8bb5469bbefcd88397d3ef86ce3eb0fee7c02))
|
|
69
67
|
|
|
70
68
|
# [1.3.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.2.1...v1.3.0) (2025-05-08)
|
|
71
69
|
|
|
72
|
-
|
|
73
70
|
### Bug Fixes
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
- encoding of data in cache entry ([9f0e747](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9f0e747b224294905427ba3060185f68fee16f0f))
|
|
73
|
+
- escape characte ([dbd9141](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dbd91413b777b2a4554597f3ca2b7f1de1163a80))
|
|
74
|
+
- readme ([31dcaa4](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/31dcaa40ac19ea42a7f4d6ca33e4642704ad1f6b))
|
|
75
|
+
- readme ([dfb69c8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/dfb69c861ddaa4a94411d419854e1c2e1e99152e))
|
|
76
|
+
- test ([13b2cb8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/13b2cb8020ef7457473b208675bf3fce4161f492))
|
|
77
|
+
- tests ([02357e1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/02357e1a7a29d997c95dce42399fef26530467d4))
|
|
78
|
+
- tests ([a5587dc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/a5587dc3701a92069da945f548991aeb0d999285))
|
|
79
|
+
- tests + re-add old implementation ([cb6d36d](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cb6d36d46008d422b4396fd580d35fa97848edb7))
|
|
80
|
+
- tests improvement ([73a3594](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/73a35946cfcd5e4811c2c09201bb02c9cdea5298))
|
|
81
|
+
- tests, make them independent from each other ([35885e3](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/35885e38a58ac0aa976c86dd964549e2d3426a79))
|
|
86
82
|
|
|
87
83
|
### Features
|
|
88
84
|
|
|
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
|
-
|
|
85
|
+
- add files ([d8a2474](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d8a24747a6a2a12e2709d017dd36c7b80b2ad49f))
|
|
86
|
+
- add more comments ([fb2f105](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fb2f10588566fad042d2e8da4999cf7bf591555d))
|
|
87
|
+
- add new invalidation logic for fetch requests + new tests ([9d0d1d2](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9d0d1d2eafb785dbe91b172358a19494c623cc68))
|
|
88
|
+
- add new tests ([836b882](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/836b88249365ea8745ca839a7dc3a3a4a77732e6))
|
|
89
|
+
- add new tests ([d0e6833](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d0e68335ce13827f74ed1be5b115f7351beebd47))
|
|
90
|
+
- adding a test page ([d4c8a8c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d4c8a8caaba7f4e5003606860babd9e50c6ed99a))
|
|
91
|
+
- adding comfortable cache testing tool on homepage ([340d5cb](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/340d5cbc929ea8dcdbef2a949e1656d014d1f3bb))
|
|
92
|
+
- adding nextjs unit tests ([368ec75](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/368ec755a8532a52526e3364cc02f64b7d4245fa))
|
|
93
|
+
- changed ([8501a4e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/8501a4ee963975f32661789e31281785cf01519a))
|
|
94
|
+
- changed hook ([92f9d3c](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/92f9d3c4b8d9afd6bbbb9cc3a69138823f4d4f87))
|
|
95
|
+
- changed hook ([6b32f0a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/6b32f0abcda935046e61242ba633728bcf23a460))
|
|
96
|
+
- extend and fix caching + chore: update readme ([7ef38a8](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7ef38a8ed2a20957cc78ffa213be3cb334736b19))
|
|
97
|
+
- extend tests ([db9bb85](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/db9bb85e398a7d6e1ba522b990de7e5e241b54b6))
|
|
98
|
+
- improve flaky ms sync delay ([6655884](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/665588474a09f1eb4f4683d2e107ec8b5b36b39a))
|
|
99
|
+
- improve readme ([926493a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/926493a198d15e32e5e4b5c619375df85c646f1c))
|
|
100
|
+
- improve tests ([3fcfadf](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3fcfadf49389fe8a7218417fb79ec74445e76cb7))
|
|
101
|
+
- remove unnecessary revalidatedTagsMap ([7b5c313](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7b5c313e91b5157f113085be75dceba8013c0e81))
|
|
102
|
+
- test is running ([6091471](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/6091471a12f954e3da4bd94db0929b0bd2cfd701))
|
|
103
|
+
- tests ([bd6904e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/bd6904e94a43cfac183a5ec86cbbea0f4e40a816))
|
|
104
|
+
- tests 2 ([974c952](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/974c952587a9d330934f49b26db84c037b3695f5))
|
|
105
|
+
- update CI with pnpm ([c1b0b33](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/c1b0b33417b416bd7755b6b2f43d0b9bea5c7690))
|
|
106
|
+
- update CI with pnpm ([d850377](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/d85037706876dcb036bb6f952a48937c3e96cba3))
|
|
107
|
+
- update CI with pnpm 10 ([c559936](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/c5599361f15c4c82fa999e16a48fcf78e53355a6))
|
|
108
|
+
- update CI with pnpm 11 ([f83708f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/f83708f76c3924b8b80dd612965dc49a95d7e18c))
|
|
109
|
+
- update CI with pnpm 2 ([235f0fc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/235f0fc8cb35dbe532091d8f545791b8dd05b6be))
|
|
110
|
+
- update CI with pnpm 2 ([cb9624e](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/cb9624e900f555bc07c734ff152c4f4a93000e54))
|
|
111
|
+
- update CI with pnpm 3 ([72c25ce](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/72c25cefa2aea6767d5a71b5470955a18f9036b9))
|
|
112
|
+
- update CI with pnpm 4 ([fff355a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/fff355a8e047d766121d255881d891fa7c5a754e))
|
|
113
|
+
- update CI with pnpm 4 ([facd58b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/facd58bdefd530d70fdbb2f7d48c9962ca2195e5))
|
|
114
|
+
- update CI with pnpm 5 ([03d9d90](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/03d9d906e852927496a58504dd9c7448e31878a1))
|
|
115
|
+
- update CI with pnpm 6 ([b5e7066](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/b5e7066ec840edfa7d6df6c6ab978c61b356c8b5))
|
|
116
|
+
- update CI with pnpm 8 ([20c3a5b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/20c3a5be9d465537240cce6ac5346554667cda68))
|
|
117
|
+
- update CI with pnpm 9 ([5160fd3](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/5160fd3e1a010a5b52b99d0e2e0de3b9035d1e88))
|
|
118
|
+
- update docs and tests ([7a46c21](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/7a46c21346d878df88283071551f06a34d71eb9a))
|
|
123
119
|
|
|
124
120
|
## [1.2.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.2.0...v1.2.1) (2025-03-28)
|
|
125
121
|
|
|
126
|
-
|
|
127
122
|
### Bug Fixes
|
|
128
123
|
|
|
129
|
-
|
|
124
|
+
- imports ([41f0cf9](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/41f0cf97506c134f8dfb37fab746cc9c066c515f))
|
|
130
125
|
|
|
131
126
|
# [1.2.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.3...v1.2.0) (2025-03-28)
|
|
132
127
|
|
|
133
|
-
|
|
134
128
|
### Features
|
|
135
129
|
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
- add tsup ([ccf122a](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/ccf122a243fade016b6b2d544acec4098222becd))
|
|
131
|
+
- add tsup ([2dffad6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2dffad68401bc273cf81a0a0d06446d34b574a5e))
|
|
138
132
|
|
|
139
133
|
## [1.1.3](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.2...v1.1.3) (2025-03-28)
|
|
140
134
|
|
|
141
|
-
|
|
142
135
|
### Bug Fixes
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
- Update README.md ([0a79274](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/0a79274e363856f07b1dce62ec74b54ad92a946e))
|
|
145
138
|
|
|
146
139
|
## [1.1.2](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.1...v1.1.2) (2025-03-28)
|
|
147
140
|
|
|
148
|
-
|
|
149
141
|
### Bug Fixes
|
|
150
142
|
|
|
151
|
-
|
|
143
|
+
- Update package.json ([3775c36](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/3775c36f3c110686856f8644315ca6e02a3c483f))
|
|
152
144
|
|
|
153
145
|
## [1.1.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.1.0...v1.1.1) (2025-03-28)
|
|
154
146
|
|
|
155
|
-
|
|
156
147
|
### Bug Fixes
|
|
157
148
|
|
|
158
|
-
|
|
149
|
+
- Update package.json ([bf17b41](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/bf17b4186c8b7d94be83c61b5d4f8622ac7cf7f0))
|
|
159
150
|
|
|
160
151
|
# [1.1.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.0.0...v1.1.0) (2025-03-28)
|
|
161
152
|
|
|
162
|
-
|
|
163
153
|
### Features
|
|
164
154
|
|
|
165
|
-
|
|
155
|
+
- Update README.md ([10b474b](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/10b474b456803be924bf4170b6cda662827202c4))
|
|
166
156
|
|
|
167
157
|
# 1.0.0 (2025-03-28)
|
|
168
158
|
|
|
169
|
-
|
|
170
159
|
### Bug Fixes
|
|
171
160
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
- double sync on key expiration ([14afef6](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/14afef6b08e3399a2aa7d6cf42a4b9b7b5ea5d33))
|
|
162
|
+
- lint errors ([2b9b138](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/2b9b138759f5754577205b58a998cc034b3b0db5))
|
|
163
|
+
- rEADME ([9e4fab1](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/9e4fab163002c34e8077285064c24ee05ba92bac))
|
|
176
164
|
|
|
177
165
|
### Features
|
|
178
166
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
167
|
+
- add handler code ([72251f5](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/72251f58446ec6fb3819ea0bdd67fc012e8a5c38))
|
|
168
|
+
- add handler code ([f674f26](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/f674f262f292e47fd228a827590e8dc10391e5cb))
|
|
169
|
+
- add handler code ([24c497f](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/24c497f1d67898e64528105c61a90b00f55ba02a))
|
|
170
|
+
- improve readme and remove logs ([79408fb](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/79408fbd488db11fcc7472b690f1fff237816da8))
|
|
171
|
+
- improve readme and remove logs ([de7a6aa](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/de7a6aa735d6295299d3a5d41d0fd00d64ac6f89))
|
|
172
|
+
- rename package and extend readme ([e16bcdc](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/e16bcdc6329ee913e1794f2bce05e1e88a08d91b))
|
|
173
|
+
- 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';
|