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
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...