File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ import { get } from '@upstash/redis';
77
77
78
78
### Edge Support
79
79
80
- > Only GET requests are supported in Edge Caching. As a result, write/update commands are not supported.
80
+ Once you set ` edgeUrl ` , all read commands are fetched using edge url. The REST URL is used for write/update commands.
81
81
82
82
``` typescript
83
83
import upstash from ' @upstash/redis' ;
@@ -90,12 +90,15 @@ const redis = upstash({
90
90
91
91
(async () => {
92
92
try {
93
+ // the below reads using edge url
93
94
const { data, error, metadata } = await redis .get (' key' );
94
95
if (error ) throw error ;
95
96
console .log (data );
96
97
// -> null | string
97
98
console .log (metadata );
98
99
// -> { edge: boolean, cache: null | 'miss' | 'hit' }
100
+ // the below reads using REST url (non-edge)
101
+ const { data2, error2, metadata2 } = await redis .get (' key' , {edge: false });
99
102
} catch (error ) {
100
103
console .error (error );
101
104
}
You can’t perform that action at this time.
0 commit comments