Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#55080 closed enhancement (fixed)

Introduce a new `wp_cache_flush_runtime()` method

Reported by: tillkruess's profile tillkruess Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.0 Priority: normal
Severity: minor Version: 6.0
Component: Cache API Keywords: has-patch commit needs-docs has-dev-note
Focuses: performance Cc:

Description

From the Object Cache Performance team: https://github.com/WordPress/performance/issues/81

Allowing users to flush the runtime (in-memory) cache, without flushing the entire persistent cache is an often requested feature for apps running long processes, such as Action Scheduler or WP-CLI.

Change History (14)

This ticket was mentioned in PR #2282 on WordPress/wordpress-develop by tillkruss.


3 years ago
#1

Implementation of the new wp_cache_flush_runtime() method to flush the runtime memory.

See https://github.com/WordPress/performance/issues/81

Trac ticket: https://core.trac.wordpress.org/ticket/55080

#2 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 6.0

spacedmonkey commented on PR #2282:


3 years ago
#3

Am I missing something here. There is implementation in WP_Object_Cache class found in class-wp-object-cache.php.
There should be a flush_runtime() method and have some implementation.

spacedmonkey commented on PR #2282:


3 years ago
#4

Am I missing something here. There is implementation in WP_Object_Cache class found in class-wp-object-cache.php.
There should be a flush_runtime() method and have some implementation.

tillkruss commented on PR #2282:


3 years ago
#5

There should be a flush_runtime() method and have some implementation.

We can do that, but since this cache implementation is non-persistent it is identical to flush. Would you want a shim for that anyhow?

spacedmonkey commented on PR #2282:


3 years ago
#6

Would you want a shim for that anyhow?

Second thoughts, no point.

#7 @flixos90
3 years ago

@tillkruess @spacedmonkey Latest PR https://github.com/WordPress/wordpress-develop/pull/2282 looks good to me!

#8 @spacedmonkey
3 years ago

  • Keywords commit added
  • Owner set to spacedmonkey
  • Status changed from new to assigned

#9 @spacedmonkey
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52772:

Cache API: Add wp_cache_flush_runtime function

Add a new function called wp_cache_flush_runtime to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache.

Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes.
Fixes: #55080.

spacedmonkey commented on PR #2282:


3 years ago
#10

Merged.

#11 @milana_cap
3 years ago

  • Keywords needs-dev-note added

#12 @milana_cap
3 years ago

  • Keywords needs-docs added

#13 @spacedmonkey
3 years ago

Dev note ready for review.

Note: See TracTickets for help on using tickets.