@@ -20,12 +20,7 @@ const match = globalX.__ROUTES__
20
20
? getRouteMatcher ( globalX . __ROUTES__ )
21
21
: ( ) => null ;
22
22
23
- const cache = new Map < string , any > ( ) ;
24
-
25
- async function cachedFetchServerSideProps ( pathname : string ) {
26
- if ( cache . has ( pathname ) ) {
27
- return cache . get ( pathname ) ;
28
- }
23
+ async function fetchServerSideProps ( pathname : string ) {
29
24
const response = await fetch ( pathname , {
30
25
method : "POST" ,
31
26
headers : {
@@ -35,9 +30,7 @@ async function cachedFetchServerSideProps(pathname: string) {
35
30
} ) ;
36
31
if ( response . ok ) {
37
32
const text = await response . text ( ) ;
38
- const props = eval ( `(${ text } )` ) ;
39
- cache . set ( pathname , props ) ;
40
- return props ;
33
+ return eval ( `(${ text } )` ) ;
41
34
}
42
35
throw new Error ( "Failed to fetch" ) ;
43
36
}
@@ -61,7 +54,7 @@ export const RouterHost = ({
61
54
const currentVersion = ++ version . current ;
62
55
const [ module , props ] = await Promise . all ( [
63
56
import ( match ( pathname . split ( "?" ) [ 0 ] ) ! . value ) ,
64
- cachedFetchServerSideProps ( pathname ) ,
57
+ fetchServerSideProps ( pathname ) ,
65
58
] ) ;
66
59
if ( currentVersion === version . current ) {
67
60
if ( props ?. redirect ) {
0 commit comments