@@ -7,96 +7,8 @@ Starting from version `2.0.0`, this package no longer depends on `@neshca/cache-
7
7
8
8
## Migration
9
9
10
- ### 1.x.x → 2.x.x
11
-
12
- > ** Note:** Starting in ` 2.0.0 ` , ` @neshca/cache-handler ` is no longer a dependency.
13
-
14
- ** Requirements:**
15
-
16
- - Next.js ` >=15.2.4 `
17
- - Redis ` >=5.5.6 `
18
-
19
- If you're only using the Redis client:
20
-
21
- ``` json
22
- "next" : " >=15.2.4" ,
23
- "@redis/client" : " >=5.5.6"
24
- ```
25
-
26
- If you need the full Redis package:
27
-
28
- ``` json
29
- "next" : " >=15.2.4" ,
30
- "redis" : " >=5.5.6"
31
- ```
32
-
33
- #### Code changes
34
-
35
- ** Before (1.x.x):**
36
-
37
- ``` js
38
- const {
39
- Next15CacheHandler ,
40
- } = require (" @fortedigital/nextjs-cache-handler/next-15-cache-handler" );
41
- module .exports = new Next15CacheHandler ();
42
- ```
43
-
44
- ** After (2.x.x+):**
45
-
46
- ``` js
47
- const { CacheHandler } = require (" @fortedigital/nextjs-cache-handler" );
48
- module .exports = CacheHandler;
49
- ```
50
-
51
- ` createBufferStringHandler ` is integrated into ` redis-strings ` and no longer required separately for Next 15+.
52
-
53
- ---
54
-
55
- ### 1.2.x → ^1.3.x
56
-
57
- #### Cache Handler
58
-
59
- ** Before:**
60
-
61
- ``` js
62
- const {
63
- Next15CacheHandler ,
64
- } = require (" @fortedigital/nextjs-cache-handler/next-15-cache-handler" );
65
- module .exports = new Next15CacheHandler ();
66
- ```
67
-
68
- ** After:**
69
-
70
- ``` js
71
- const { Next15CacheHandler } = require (" @fortedigital/nextjs-cache-handler" );
72
- module .exports = Next15CacheHandler;
73
- ```
74
-
75
- #### Instrumentation
76
-
77
- ** Before:**
78
-
79
- ``` js
80
- if (process .env .NEXT_RUNTIME === " nodejs" ) {
81
- const { registerInitialCache } = await import (
82
- " @neshca/cache-handler/instrumentation"
83
- );
84
- const CacheHandler = (await import (" ./cache-handler.js" )).default ;
85
- await registerInitialCache (CacheHandler);
86
- }
87
- ```
88
-
89
- ** After:**
90
-
91
- ``` js
92
- if (process .env .NEXT_RUNTIME === " nodejs" ) {
93
- const { registerInitialCache } = await import (
94
- " @fortedigital/nextjs-cache-handler/instrumentation"
95
- );
96
- const CacheHandler = (await import (" ./cache-handler.js" )).default ;
97
- await registerInitialCache (CacheHandler);
98
- }
99
- ```
10
+ - [ 1.x.x → ^2.x.x] ( docs\migration\1_x_x__2_x_x.md )
11
+ - [ 1.2.x -> ^1.3.x] ( docs\migration\1_2_x__1_3_x.md )
100
12
101
13
---
102
14
@@ -108,8 +20,9 @@ If upgrading from Next 14 or earlier, **flush your Redis cache**. Cache formats
108
20
109
21
## Next 15 Support
110
22
111
- ` @neshca/cache-handler ` does not support Next.js 15+ . Prior to 2.0.0, this package provided wrappers and enhancements.
23
+ ` @neshca/cache-handler ` does not support Next.js 15. Prior to 2.0.0, this package provided wrappers and enhancements.
112
24
From version 2.0.0 onward, ` @fortedigital/nextjs-cache-handler ` is a standalone solution with no dependency on ` @neshca/cache-handler ` .
25
+ ` @fortedigital/nextjs-cache-handler ` is fully compatible with Next.js 15 and [ redis 5] ( https://www.npmjs.com/package/redis ) .
113
26
114
27
We aim to keep up with new Next.js releases and will introduce major changes with appropriate version bumps.
115
28
@@ -249,7 +162,7 @@ const compositeHandler = createCompositeHandler({
249
162
250
163
---
251
164
252
- ### ⚠️ ` buffer- string- decorator` | **REMOVED IN 2.0.0!** - integrated into the core package ⚠️
165
+ ### ⚠️ ` buffer- string- decorator` | **REMOVED IN 2.0.0!** - integrated into the core package
253
166
254
167
#### Features:
255
168
@@ -280,7 +193,7 @@ const bufferStringDecorator =
280
193
281
194
#### Full example
282
195
283
- ` ./ examples/ redis- minimal`
196
+ [Example project]( ./examples/redis-minimal)
284
197
285
198
#### Example ` cache- handler .js ` .
286
199
0 commit comments