Closed stuartcusackie closed 6 months ago
As its tracking the nav, then you could use an entry saving listener to clear the cache, eg:
if ($entry->isDirty('published')) {
Tracker::invalidateTag('nav:main');
}
The reason its not clearing automatically is its not tracking the entry id, which it does in antlers.
Ah okay. Looks like need to go down the custom invalidator road.
Thanks for the explanation and advice.
Hi, I don't know if you remember this post I opened on Statamic/ideas. I was requesting that unpublishing an entry that is contained in a nav should invalidate the cache for all urls using that nav.
I've been testing this out locally with your package but publishing / unpublishing an entry in my main nav but my static cache is not being cleared.
Bear in mind that I am using Blade and some non-standard methods of rendering my navigation, for example this how I render my nav:
It seems that the nav tag call is being detected:
Is this a bug or am I missing something?
Thanks!