File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
packages/qwik-router/src/middleware/request-handler Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ export function loaderHandler(routeLoaders: LoaderInternal[]): RequestHandler {
108
108
// Set cache headers - aggressive for loaders
109
109
requestEv . cacheControl ( {
110
110
maxAge : 300 , // 5 minutes
111
- staleWhileRevalidate : 3600 , // 1 hour
112
111
} ) ;
113
112
114
113
const data = await _serialize ( [ loaders [ loaderId ] ] ) ;
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ export async function qDataHandler(requestEv: RequestEvent) {
32
32
33
33
// Set cache headers
34
34
requestEv . cacheControl ( {
35
- maxAge : 300 , // 5 minutes
36
- staleWhileRevalidate : 3600 , // 1 hour
35
+ maxAge : 60 , // 1 minute
37
36
} ) ;
38
37
39
38
// write just the page json data to the response body
Original file line number Diff line number Diff line change @@ -399,6 +399,10 @@ export interface CacheControlOptions {
399
399
/**
400
400
* The stale-while-revalidate response directive indicates that the cache could reuse a stale
401
401
* response while it revalidates it to a cache.
402
+ *
403
+ * Note: there is no mechanism that updates the application when the revalidation happens. Use
404
+ * this only when you know you will be fetching the revalidated resource again in the very near
405
+ * future.
402
406
*/
403
407
staleWhileRevalidate ?: number ;
404
408
You can’t perform that action at this time.
0 commit comments