Skip to content

Commit

Permalink
fix: add cache revalidation for root pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Oct 14, 2024
1 parent c5bbfa8 commit ce28368
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/sanity-cms/api/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export const createRevalidateHandler = ({
revalidatePath(`${schemaUrl}`);
} else {
revalidatePath(`${schemaUrl}${slug}`);
// Also revalidate the root schema url (if it's not the landing page) Eg: /blog
revalidatePath(schemaUrl.replaceAll('/', ''));
}
}
}
Expand Down

0 comments on commit ce28368

Please sign in to comment.