Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

menu_cache

No security coverage
View on drupal.org

By default, menu blocks contain cache tags for each node that the menu links to, so that the menu can be invalidated if access to the node changes. This can result in a lot of cache tags for large menus and frequently invalidate large parts of a site if any of those nodes is saved.

Warning: This module is a proof of concept and attempts to optimize this by making several assumptions, it also depends on the following core issue #3485030: Avoid saving menu links through node form when they do not change:

  • Caching is only optimized for anonymous users
  • It is assumed that anonymous users can access all published content and can not access unpublished content
  • Only node links and cache tags are supported and invalidated
  • It does not only support menu_link_content links as it uses the menu tree storage API, but will only find routed node links.
  • Menu link content entities are not saved when there is no real change to them, specifically this might currently not work with the token module or other modules that extend how menu_ui interacts with nodes

Do not use this on production yet without extensive testing. If any of those assumptions are not true for your site, menu links will either remain visible when they are inaccessible or not become visible when they should.

Future iterations will add the ability to customize those assumptions with alternative strategies. This will likely only happen once the depending core issue is fixed.

Additional Requirements

A patch for ##3485030: Avoid saving menu links through node form when they do not change

Activity

Total releases
1
First release
Jan 2025
Latest release
1 year ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.x-dev Dev Jan 10, 2025