i have a cached function and when i revalidate it using revalidateTag the cache gets revalidated but the static pages using that cached function do not get regenerated as they should be. do i need to add something in my nextjs config or in site settings? its working as expected when i run my application locally
share a link to your site, sites ID and project ID.
i setup an example website for demonstration heres the link: https://example-nextjs-app.appwrite.network/, site id: 68b68f54002813a4411d, project id: 68b68f250012b7afacc2. when you click revalidate the cached function gets revalidated and time changes but the static page does not appear to be regenerated so when you refresh you again see the old time not the time after revalidation.
here is the relevant part of code
// page.tsx
import { cachedFn } from "./actions";
import { Cc } from "./cc";
export default async function Home() {
const time = await cachedFn();
return (
<>
<p>hello world!</p>
<p>time: {time.toString()}</p>
<Cc />
</>
);
}
// cc.tsx
"use client";
import { useEffect } from "react";
import { cachedFn, revalidateFn } from "./actions";
export function Cc() {
useEffect(() => {
cachedFn().then((v) => console.log("time is", v.toString()));
});
return <button onClick={revalidateFn}>revalidate</button>;
}
// actions.ts
"use server";
import { revalidateTag, unstable_cache } from "next/cache";
export const cachedFn = unstable_cache(async () => new Date(), ["cachedFn"], {
tags: ["cachedFn"],
});
export async function revalidateFn() {
revalidateTag("cachedFn");
}
@eldad hello?
For prompt support, you can upgrade to Cloud Pro and use our premium email support. For the actual topic - I messaged our team and they are looking into it.
ok thanks π
hello @eldad it doesnt seem like the problem has been fixed sorry for pinging
[SOLVED] Nextjs ISR (incremental static regeneration) is not working on appwrite sites?
but this issue has not been solved yet π€
Nextjs ISR (incremental static regeneration) is not working on appwrite sites?
Sorry, I had read the opposite π
hello @eldad is this ever going to get fixed? its been a month almost
To share an update. This has been discussed internally this week. We've agreed on a direction for how we're going to support this and I expect the implementation to not take too long. Basically we'll make sure relevant cache headers are supported and will introduce an API to purge cache from the Appwrite CDN.
amazing!
is this fixed yet?
its been 3 months and this still hasnt been fixed π
Recommended threads
- Is this normal in the self host custom d...
when i try to add custom domain to the project did not see this in 1.8.0 ok when pressed the retry it says "DNS verification failed with resolver 8.8.8.8. Domai...
- No server error on selfhosted appwrite
Please help me, my clients is ask what happen on their data? How can i make it up again?
- Upgrading selfhost version?
It is okay to upgrade version to higher one, of my current version is 1.7.4 to 1.8.1. Is that safe to do cause my clients already have data on that? Also is a...