Skip to content

Experiment: Universal group flushing.#2996

Closed
peterwilsoncc wants to merge 2 commits intoWordPress:trunkfrom
peterwilsoncc:4476-universal-group-flushing
Closed

Experiment: Universal group flushing.#2996
peterwilsoncc wants to merge 2 commits intoWordPress:trunkfrom
peterwilsoncc:4476-universal-group-flushing

Conversation

@peterwilsoncc
Copy link
Copy Markdown
Contributor

@spacedmonkey @tillkruss

Is this too silly to even consider? I suspect it might be.

WIP -- needs some docs updated, etc.

Comment on lines +69 to +71
if ( ! wp_cache_supports_flush_group() ) {
$group .= wp_cache_get_last_changed( $group );
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to deal with multi functions but getting a logic check before doing so.

@peterwilsoncc
Copy link
Copy Markdown
Contributor Author

Nevermind, this won't work.

The wp_cache_* functions are effectively pluggable and it is expected the drop-ins will define them. A persistent drop-in that doesn't support group flushing would need to be updated to match hacking the groups with the last_changed key.

I'll continue investigating using an action on the last_changed key to allow drop-ins to hook in to that to trigger a group flush.

add_action(
  'wp_cache_set_last_changed', 
  function( $group ) {
    global $object_cache;
    $object_cache->flush_group( $group );
  }
);

@spacedmonkey
Copy link
Copy Markdown
Member

spacedmonkey commented Jul 22, 2022

Sadly this will not work 😢

@peterwilsoncc peterwilsoncc deleted the 4476-universal-group-flushing branch July 23, 2022 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants