#6746 closed defect (bug) (fixed)
can't we cache _get_post_ancestors()?
| Reported by: | Denis-de-Bernardy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5.1 |
| Component: | Optimization | Version: | 2.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
It seems there's a reason for not doing so, but when your site has a hundred static pages, displaying the pages widget readily takes a second or more...
Attachments (1)
Change History (7)
#2
@
18 years ago
further investigation leads me to identify get_permalink() as the likely culprit for the insane number of queries.
brings me to a thought: isn't reasonable to assume that, if at one point another a page gets queried, there's a 99% change that get_permalink() will get called? if so, it would make sense to get all the ancestors and their details whenever they're not in the cache already.
D.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
figures for a site with 90 static pages:
@ init hook: 7 queries - 0.160 seconds
@ template_redirect hook: 11 queries - 0.183 seconds
@ wp_footer hook: 153 queries - 0.403 seconds
the 153 queries (almost all related to _get_post_ancestors()) take as much as a second every now and then...