WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 9 months ago

#40362 new defect (bug)

Remove `blog-id-cache` cache group

Reported by: flixos90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch 2nd-opinion
Focuses: multisite Cc:

Description

The function get_blog_id_from_url() is the only function that uses the old blog-id-cache group. Since the introduction of WP_Site_Query it's basically redundant in there though, since site query results are cached anyway.

Therefore I think we should remove the cache read and write actions in that function. We can then also remove the cache group completely (from clean_blog_cache() and registration as a "global group").

Attachments (1)

40362.patch (4.5 KB) - added by spacedmonkey 15 months ago.

Download all attachments as: .zip

Change History (8)

#1 @spacedmonkey
15 months ago

  • Keywords has-patch dev-feedback added; needs-patch removed

My patch removes uses of the group in core and in tests. I have removed the global group, as plugins may be using it for something.

I believe we should be getting rid of the all cache look ups that use domain / path. I believe most domain mapping solutions out there will break the cache invalidation.

#2 @jeremyfelt
15 months ago

  • Keywords good-first-bug removed

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


15 months ago

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


15 months ago

#5 @flixos90
15 months ago

  • Keywords 2nd-opinion added; dev-feedback removed

Per bug-scrub discussion:

Maybe we should hold off removing that cache, although it's redundant. That is because WP_Site_Query caches are invalidated on every change to any site (via last_changed), while blog-id-cache keys are only invalidated on updates to the specific site. So the blog-id-cache keys are much more "stable".

I'm not sure whether this is actually a reason to hold off, but we need to discuss and further investigate.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


15 months ago

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


9 months ago

Note: See TracTickets for help on using tickets.