[wp-trac] [WordPress Trac] #27003: Introduce wp_get_network() and begin cleanup of multisite load
WordPress Trac
noreply at wordpress.org
Thu Feb 20 05:47:38 UTC 2014
#27003: Introduce wp_get_network() and begin cleanup of multisite load
--------------------------------------------------+------------------------
Reporter: jeremyfelt | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.9
Component: Bootstrap/Load | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-testing dev-feedback | Focuses: multisite
--------------------------------------------------+------------------------
Comment (by jeremyfelt):
[attachment:27003.16.diff] builds on Nacin's [attachment:27003.14.diff]
and adds caching for requests made to `get_network_by_path()`. Keys are an
md5 hash of the requested domain and path, along the same lines of the key
creation in `WP_Theme`.
{{{
$request_cache_hash = md5( $domain . '/' . $path );
$network_id = wp_cache_get( 'network_' . $request_cache_hash, 'networks'
);
}}}
I'm not sure where invalidation would be needed here. This is a cache of a
specific request and for it to become invalid, the network ID matched with
the domain and path would have to change. This doesn't seem too common,
though we can clear or reset the cache value way down the road when some
sort of network management appears in the admin. Maybe?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27003#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list