[wp-trac] [WordPress Trac] #57498: Unnecessary writes to cache in `WP_Query`

WordPress Trac noreply at wordpress.org
Mon Jan 30 12:45:11 UTC 2023


#57498: Unnecessary writes to cache in `WP_Query`
--------------------------+--------------------------
 Reporter:  spacedmonkey  |       Owner:  flixos90
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  6.1.2
Component:  Query         |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by spacedmonkey):

 Doing some research into this, look at different add methods for different
 object caching drop-ins

 - [https://github.com/Automattic/wp-
 memcached/blob/3eb1a6359e76e6401ea60b35b5eb78d6a33fdb46/object-
 cache.php#L174-L235 Automattic memcached]
 - [https://github.com/pantheon-systems/wp-
 redis/blob/b0ba3867f6ddd170359773ed661a2cd81fdc6122/object-
 cache.php#L437-L452 pantheon-systems redis]
 - [https://github.com/W3EDGE/w3-total-
 cache/blob/3b9fb1146989ce68c4130c5a247aed9efd6d9744/Cache_Memcached.php#L122-L127
 W3 Edge memcached]
 - [https://github.com/OllieJones/sqlite-object-
 cache/blob/898ed2d2aae778fab24b1cf1f2a464f111791578/assets/drop-in/object-
 cache.php#L1129-L1152 SQlite object cache]
 - [https://github.com/mgmartel/memcached-
 redux/blob/d645fa59af42263ad31cfcfc9c223214f8c478d6/object-
 cache.php#L135-L159 Memcached redux]

 Some both to check if the exist exists before writing it and others do
 not. I am starting to think this is not a big problem. It is kind of up to
 the object cache implementor to check if it exists before writing.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57498#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list