Consider purging everything when a nav menu is updated
danielbachhuber opened this issue · 4 comments
From #112
Changes @ /wp-admin/nav-menus.php trigger for every term
purge_term
andaction_clean_term_cache
and for every itemaction_clean_post_cache
andpurge_post_with_related
.There is not a lot we can do about it in the current setup, but we can at least make sure that it clears the whole cache as this most likely impacts the whole site.
Do you have a better idea?
At the moment is clearing a lot of keys for nothing.
I don't like auto-purging the whole cache.
However, we could pop an admin notice informing the user that the action they just took changes content on a lot of pages and if they want it to be immediately visible, they should purge the whole cache. E.g. make it something for the individual site admin to decide on.
Nav menus are being rebuilt as Gutenberg blocks in WordPress core, so this isn't an optimization worth solving for at this point.
Nav menus are being rebuilt as Gutenberg blocks in WordPress core, so this isn't an optimization worth solving for at this point.
FWIW not all themes are using the new navigation block. Most of my clients have custom themes built with Sage and use Navi (https://github.com/Log1x/navi) to generate the markup.
Considering nav updates are relatively infrequent on most sites, I think clearing the whole cache would be preferable to requiring site owners to log into Pantheon to manually clear the cache in order to see the update right away.