Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Nuxt Server Side Components ReInvalidation - Nuxt
N
Nuxt
•
2y ago
Kiran Kumar Reddy Vanga
Nuxt Server Side Components ReInvalidation
Please suggest implementation fixes of Nuxt Server Side Components
(SSCs
) revalidation
,
(pages
/app
.sever
.ts
)
:
<script setup
>
const
{ data
}
= await useFetch
(
"
/api
/apps
"
,
{
transform
:
(
_apps
)
=
>
_apps
.data
,
}
)
;
<
/script
>
server
/api
/apps
.get
.ts
/
/ server
/users
.ts
export default defineEventHandler
(async
(event
)
=
>
{
try
{
const response
= await fetch
(
"API
/apps
"
)
;
const data
= await response
.json
(
)
;
return
{data
}
;
} catch
(error
)
{
return
{error
}
;
}
}
)
;
In nuxt
.config
.ts
, I
've set up
/api for caching
. After the initial deployment with 4 records and static server pages created
, will the local server components not update with new records and server pages after 300 seconds
?
/
/
https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig
(
{
experimental
:
{
componentIslands
: true
,
}
,
devtools
:
{ enabled
: true
}
,
serverMiddleware
:
[
/
/ Add server middleware for handling API routes
{ path
:
'
/api
'
, handler
:
'
~
/api
/apps
.get
.ts
'
}
/
/ Adjust the path and handler as needed
]
,
routeRules
:
{
'
/
'
:
{ prerender
: true
}
,
'
/apps
'
:
{ swr
: 3600
}
,
'
/apps
/
*
'
:
{ swr
: 3600
}
,
'
/api
/
'
:
{ cache
:
{ maxAge
: 300
}
}
,
}
,
}
)
What changes to be done to achive this
?
Nuxt
Nuxt Configuration
Discover all the options you can use in your nuxt
.config
.ts file
.
Nuxt
Join
Nuxt Community Chat Server
31,817
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Accessing components list on server side plugin
N
Nuxt / ❓・help
14mo ago
useLogger from `@nuxt/kit` on server side
N
Nuxt / ❓・help
2y ago
Generate Sitemap on server side of nuxt
N
Nuxt / ❓・help
3y ago