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 {
108108 // Set cache headers - aggressive for loaders
109109 requestEv . cacheControl ( {
110110 maxAge : 300 , // 5 minutes
111- staleWhileRevalidate : 3600 , // 1 hour
112111 } ) ;
113112
114113 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) {
3232
3333 // Set cache headers
3434 requestEv . cacheControl ( {
35- maxAge : 300 , // 5 minutes
36- staleWhileRevalidate : 3600 , // 1 hour
35+ maxAge : 60 , // 1 minute
3736 } ) ;
3837
3938 // 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 {
399399 /**
400400 * The stale-while-revalidate response directive indicates that the cache could reuse a stale
401401 * 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.
402406 */
403407 staleWhileRevalidate ?: number ;
404408
You can’t perform that action at this time.
0 commit comments