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.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/automattic/vip-wp-menu-nav-cache-v2/archive/refs/heads/trunk.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

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.