File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
packages/qwik-city/src/runtime/src Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const loadClientData = async (
28
28
let resolveFn : ( ) => void | undefined ;
29
29
30
30
if ( ! qData ) {
31
- const fetchOptions = getFetchOptions ( opts ?. action ) ;
31
+ const fetchOptions = getFetchOptions ( opts ?. action , opts ?. clearCache ) ;
32
32
if ( opts ?. action ) {
33
33
opts . action . data = undefined ;
34
34
}
@@ -88,16 +88,22 @@ export const loadClientData = async (
88
88
} ) ;
89
89
} ;
90
90
91
- const getFetchOptions = ( action : RouteActionValue | undefined ) : RequestInit => {
91
+ const getFetchOptions = (
92
+ action : RouteActionValue | undefined ,
93
+ noCache : boolean | undefined
94
+ ) : RequestInit | undefined => {
92
95
const actionData = action ?. data ;
93
96
if ( ! actionData ) {
94
- return {
95
- cache : 'no-cache' ,
96
- headers : {
97
- 'Cache-Control' : 'no-cache' ,
98
- Pragma : 'no-cache' ,
99
- } ,
100
- } ;
97
+ if ( noCache ) {
98
+ return {
99
+ cache : 'no-cache' ,
100
+ headers : {
101
+ 'Cache-Control' : 'no-cache' ,
102
+ Pragma : 'no-cache' ,
103
+ } ,
104
+ } ;
105
+ }
106
+ return undefined ;
101
107
}
102
108
if ( actionData instanceof FormData ) {
103
109
return {
You can’t perform that action at this time.
0 commit comments