Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#4097 closed defect (bug) (invalid)

get_pages: global page_cache not populated on cache retrieval

Reported by: kevinB Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: get_page cache
Focuses: Cc:


In get_pages, update_page_cache is called to populate global $page_cache following a query, but not following cache retrieval.

Attachments (1)

get_pages-pagecache.diff (581 bytes) - added by kevinB 11 years ago.

Download all attachments as: .zip

Change History (6)

#1 follow-up: @rob1n
11 years ago

Maybe I'm missing something here, but why would you want to update the page cache if you retrieved the page successfully from the cache? Seems you would just apply the filters, then move along. No modifications [that i can see]...

#2 in reply to: ↑ 1 @kevinB
11 years ago

Replying to rob1n:

why would you want to update the page cache if you retrieved the page successfully from the cache?

The page was just retrieved from wp_cache; I'm talking about global $page_cache.

I was thinking that $page_cache is always available as a memory resident cache for the php request, but that wp_cache is only available with ENABLE_CACHE.

Now I see that even with DISABLE_CACHE, wp_cache will cache to memory. My mistake.

Maybe the real question here is why does global $page_cache exist at all? get_page_children is the only calling function. Couldn't it call wp_cache_get($page_id, 'pages') instead? On the other hand, if $page_cache is being retained there as a performance enhancement over wp_cache_get, it should be populated consistently.

#3 @rob1n
11 years ago

  • Milestone changed from 2.2 to 2.3

#4 @rob1n
10 years ago

  • Owner rob1n deleted

#5 @darkdragon
10 years ago

  • Milestone 2.4 deleted
  • Resolution set to invalid
  • Status changed from new to closed

$page_cache no longer exists, therefore this ticket is marked as invalid since the original ticket information no longer pertains to the current version.

It is likely that $page_cache was removed since it wasn't being removed as part of another ticket and committed in a past revision.

No ticket or revision will be given, since I don't have it off hand, however checking the trunk shows that the variable does not exist.

Note: See TracTickets for help on using tickets.