I was wondering if there is a way to revalidate entity page and all pages related to it within its hierarchy.
For example:
blog
(page with a list of all blog posts)blog/[post-id]
(page with a particular blog post)
I'm updating a particular blog post in my CMS and I want to revalidate this blog post. So I'm sending a revalidation request where paths === '/blog/[post-id]'
, it revalidates and everything is fine. However, since I have a page with a list of all blog posts, I have to revalidate this page as well.
So my question is, is there anyway to optimize this process so we can revalidate both pages (or more possibly) with just one revalidate request?
I've written some logic to automate this process but I want to hear your opinion before I go too deep into it