Make WordPress Core


Ignore:
Timestamp:
08/25/2022 04:21:40 AM (2 years ago)
Author:
peterwilsoncc
Message:

Query: Cache post ID database query within WP_Query.

Add object caching to the first database query in WP_Query, ie the database query for post IDs that match the desired result. Randomly ordered queries remain uncached as they are not intended to return consistent results.

Caching of ID queries is enabled by default, per the post object, term and meta caches.

Props spacedmonkey, aaroncampbell, batmoo, chriscct7, costdev, dd32, drewapicture, johnbillion, mukesh27, nacin, ocean90, peterwilsoncc, ryan, scribu, sergeybiryukov, tillkruss.
Fixes #22176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/commentFeed.php

    r53066 r53941  
    4040            'ignore_sticky_posts'    => false,
    4141            'no_found_rows'          => true,
     42            'cache_results'          => false,
    4243        );
    4344        $q1->query( $args );
     
    99100            'update_post_term_cache' => false,
    100101            'ignore_sticky_posts'    => false,
     102            'cache_results'          => false,
    101103        );
    102104
Note: See TracChangeset for help on using the changeset viewer.