WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#36798 closed enhancement (duplicate)

Cache custom menus

Reported by: selnomeria Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description (last modified by swissspidy)

hi..
i had an idea - developers should have an ability to set a constant i.e.

USE_STATIC_CUSTOM_MENU('menu_name') = true;

in general, output of custom_menus on front-end, takes long (sometimes 1 second)..
so, i think, that the custom-menu output should be saved as static string, and that should be output on front-end request by visitors...
and that static string should be changed/ updated every time the custom-menu is edited, or when any of that custom-menu's item is modified...
i think, it will save huge resources over millions of sites/hosting..

p.s. of course, somehow, "current-menu-item" should be added while front-end request..

Change History (1)

#1 @swissspidy
3 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Summary changed from custom menu - OPTIMIZE QUERY! to Cache custom menus

Hey there

Thanks for creating this ticket. What you suggest is fragment caching for nav menus, which was already proposed in #36225. I'm therefore closing this as a duplicate.

Note: See TracTickets for help on using tickets.