Skip to content

Commit 1af3721

Browse files
fix(server): set default response maxAge to 1
1 parent 489aa00 commit 1af3721

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/config/caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export default defineNuxtConfig({
4242
// Control stale-while-revalidate behavior
4343
// @default true
4444
swr: true,
45-
// Set a custom expiration time in seconds
46-
// @default 60 * 60
47-
maxAge: 60 * 60
45+
// Number of seconds to cache the query response
46+
// @default 1
47+
maxAge: 1
4848
}
4949
}
5050
})

docs/config/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ interface ModuleOptions {
117117
swr?: boolean
118118

119119
/**
120-
* Maximum age that cache is valid in seconds
120+
* Number of seconds to cache the query response
121121
*
122122
* @see https://nitro.unjs.io/guide/cache#options
123-
* @default 60 * 60
123+
* @default 1
124124
*/
125125
maxAge?: number
126126
}

src/module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ export interface ModuleOptions {
103103
swr?: boolean
104104

105105
/**
106-
* Maximum age that cache is valid in seconds
106+
* Number of seconds to cache the query response
107107
*
108108
* @see https://nitro.unjs.io/guide/cache#options
109-
* @default 60 * 60
109+
* @default 1
110110
*/
111111
maxAge?: number
112112
}
@@ -135,7 +135,7 @@ export default defineNuxtModule<ModuleOptions>({
135135
cache: false,
136136
storage: 'cache',
137137
swr: true,
138-
maxAge: 60 * 60,
138+
maxAge: 1,
139139
},
140140
},
141141
async setup(options, nuxt) {

0 commit comments

Comments
 (0)