Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 5 months 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.


8 months ago

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
8 months ago

  • Milestone changed from Awaiting Review to 6.0

#3 @prbot
8 months ago

spacedmonkey commented on PR #2282:

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.

#4 @prbot
8 months ago

spacedmonkey commented on PR #2282:

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.

#5 @prbot
8 months ago

tillkruss commented on PR #2282:

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?

#6 @prbot
8 months ago

spacedmonkey commented on PR #2282:

Would you want a shim for that anyhow?

Second thoughts, no point.

#7 @flixos90
8 months ago

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

#8 @spacedmonkey
8 months ago

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

#9 @spacedmonkey
8 months 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.

#10 @prbot
8 months ago

spacedmonkey commented on PR #2282:

Merged.

#11 @milana_cap
6 months ago

  • Keywords needs-dev-note added

#12 @milana_cap
6 months ago

  • Keywords needs-docs added

#13 @spacedmonkey
5 months ago

Dev note ready for review.

Note: See TracTickets for help on using tickets.