use cache working in dev, not prod
Unanswered
Band-tailed Pigeon posted this in #help-forum
Band-tailed PigeonOP
"use cache";
import { cacheLife } from "next/cache";
import { redirect } from "next/navigation";
export default async function Home({
params,
}: {
params: Promise<{ slug: string }>;
}) {
cacheLife("max");
...19 Replies
Band-tailed PigeonOP
To add more
in dev mode, when i navigate between links, it is instant
but when in production i keep on seeing skeleton loading as if no cache
Band-tailed PigeonOP
i did pnpm start
cacheComponents: true,i do have a client component in my layout.tsx but it is in a separate file, imported into layout.tsx
even i iremove the client component, the issue persists
Band-tailed PigeonOP
ok the problem is with using params
now cant think of another way
docs stated search params, not dynamic route ones
Band-tailed PigeonOP
update
i used export function generateStaticParams() {
its fixed now
would appricate other solutions to this
coz generateStaticParams aint dynamic
coz generateStaticParams aint dynamic
Northeast Congo Lion
If you’re setting max cache life time doesn’t it imply that you’d want a static page instead of dynamic ?
the text is a lot
that im fetching
i dont know any other approach except caching the component