Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This project optimizes menu block caching for anonymous users by reducing the number of cache tags used. It does this by assuming anonymous users can access all published content and handles only node links. Users should test this module thoroughly before production use, as it relies on several core assumptions.

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
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

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