Next.js Discord

Discord Forum

Cache behaviour problems

Answered
Green Violet-ear posted this in #help-forum
Open in Discord
Green Violet-earOP
Hello 👋🏽,
I have a S3 bucket website behind a CloudFront CDN with a nextjs static generated site.
On one page I consume a RSS api to get some jobs offering. This page is always cached at the last build time and never change after.
I have deactivated Cloudfront and S3 cache.
I have read NextJS documentation and performed a fetch with the option { cache: "no-store" }.
But I continue to have the same behaviour.
The workflow:

Page component => Fetch app route api (await fetch("/api/my-jobs-rss", { cache: "no-store" });) => App route fetch real API (await fetch("https://myrealAPI/jobs.aspx",{cache: "no-store" });) => Page Component results

I'm not very familiar with NextJS framework 🙏🏽
Answered by Anay-208
server side actions won't work on static website.
I'm not sure but server side actions will just run once during build, and that route will return the same data(static). Its similar to static props
View full answer

14 Replies

Green Violet-earOP
Yes
@Green Violet-ear Yes
server side actions won't work on static website.
I'm not sure but server side actions will just run once during build, and that route will return the same data(static). Its similar to static props
Answer
I recommend you to use amplify
or vercel
Green Violet-earOP
There is a way to perform a request without actions?
You can't do that in static site
@Green Violet-ear There is a way to perform a request without actions?
you can deploy a seperate api then
use nextjs in static, and deploy a seperate api
Green Violet-earOP
Ok i see but what I do not understand is the way the documentation seems to say it’s possible https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating
Green Violet-earOP
Ha ok 👌🏻
Thank you very much 🙏🏻