Make WordPress Core

Opened 16 years ago

Closed 10 years ago

#12538 closed defect (bug) (invalid)

WP should cache menus

Reported by: Denis-de-Bernardy Owned by:
Priority: normal Milestone:
Component: Menus Version: 3.0
Severity: normal Keywords: needs-patch
Cc: Focuses: performance

Description

There's a prime example of how to do this in the menu ticket (i.e. the plugin I attached in #11817).

Shouldn't we be doing this in WP as well?

It basically goes:

  • if it's a page, then try a post meta
  • if it's search/404 request, then try a transient
  • if it's anything else, then try a transient

The plugin also handles conditional flushing of the cache based on whether or not the permalink and/or the label changed.

Change History (13)

#1 @ptahdunbar
16 years ago

  • Cc ptahdunbar added
  • Component GeneralMenus
  • Owner set to ryan

#2 @ptahdunbar
16 years ago

  • Resolutionfixed
  • Status newclosed

Fixed in r13704

#3 @nacin
16 years ago

  • Resolution fixed
  • Status closedreopened

#4 follow-up: @scribu
16 years ago

  • Keywords close added

I'm not so sure this should go into core, the same way that widget caching isn't in core.

The only thing that's cached is RSS feeds, since we don't want to flood other sites.

Installing a plugin like WP Super Cache solves the caching problem for the entire page.

#5 @voyagerfan5761
16 years ago

  • Cc WordPress@… added

#6 @ryan
16 years ago

  • Milestone 3.0
  • Resolutionwontfix
  • Status reopenedclosed

#7 in reply to: ↑ 4 @prettyboymp
15 years ago

  • Keywords close removed
  • Resolution wontfix
  • Status closedreopened

Replying to scribu:

I'm not so sure this should go into core, the same way that widget caching isn't in core.

The only thing that's cached is RSS feeds, since we don't want to flood other sites.

Installing a plugin like WP Super Cache solves the caching problem for the entire page.

I think this needs to be revisited, even if it's just creating a way to allow a plugin to cache the wp_get_nav_menu_items() function. A simple menu that is only one level deep causes 3 extra queries.

Almost all core widgets have caching or use functions that have caching built in and WP Super Cache isn't a solution for sites that have a high percentage of logged in users.

#8 @SergeyBiryukov
15 years ago

  • MilestoneAwaiting Review

#9 @mdawaffe
13 years ago

  • Keywords needs-patch added

#10 @ryan
12 years ago

  • Owner ryan removed
  • Status reopenedassigned

#11 @chriscct7
11 years ago

  • Focuses performance added

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


10 years ago

#13 @peterwilsoncc
10 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status assignedclosed

Core appears to have changed around this code since the last substantive update. Doesn't appear to remain valid.

Note: See TracTickets for help on using tickets.