WP Manifestindependent plugin directory
manifest / performance / vip-wp-menu-nav-cache-v2

[VIP] WP Menu Nav Cache (v2)

Function-based `wp_nav_menu()` output caching plugin for WordPress/VIP-style environments.

by VIP · github.com/automattic/vip-wp-menu-nav-cache-v2 · website

0stars
1forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/automattic/vip-wp-menu-nav-cache-v2/archive/refs/heads/trunk.zip

Function-based wp_nav_menu() output caching plugin for WordPress/VIP-style environments.

Core behavior

  • Caches menu HTML via pre_wp_nav_menu + wp_nav_menu hooks.
  • Uses generation-based invalidation (wpvip_nav_menu_generation) in object cache group wpvip_nav_menu.
  • Defaults to a 1-hour cache TTL (HOUR_IN_SECONDS), filterable with wpvip_nav_menu_cache_ttl.
  • Ships the wpvip_nav_menu_should_cache filter and default callback that disables cache for logged-in users and singular pages.

Additional salvage from Automattic/cache-nav-menus

  • Adds parse_query hook to force cache_results = true for nav_menu_item queries, reducing database pressure on cold paths.

Composer

composer install

Autoload uses autoload.files for src/functions.php.