CedsTrash
CedsTrash
NNuxt
Created by CedsTrash on 8/22/2024 in #❓・help
defineCachedEventHandler - set maxAge from environment variable
I got it to work like this: maxAge: Number(process.env.NITRO_CACHE_TTL) || 1, Arrow function just don't work. Thanks a lot for your help!
9 replies
NNuxt
Created by CedsTrash on 8/22/2024 in #❓・help
defineCachedEventHandler - set maxAge from environment variable
Yes!
9 replies
NNuxt
Created by CedsTrash on 8/22/2024 in #❓・help
defineCachedEventHandler - set maxAge from environment variable
maxAge: import.meta.dev ? config?.NITRO_CACHE_TTL : 1 doesn't work because config isn't defined.
9 replies
NNuxt
Created by CedsTrash on 8/22/2024 in #❓・help
defineCachedEventHandler - set maxAge from environment variable
I've tried the following:
maxAge: () => { return 1 },
maxAge: () => {
const config = useRuntimeConfig()
return Number(config?.NITRO_CACHE_TTL) || 1
},
maxAge: () => { return 1 },
maxAge: () => {
const config = useRuntimeConfig()
return Number(config?.NITRO_CACHE_TTL) || 1
},
9 replies
NNuxt
Created by CedsTrash on 8/22/2024 in #❓・help
defineCachedEventHandler - set maxAge from environment variable
No description
9 replies