Consolidate `current_site_name` cache-key to `site_name`
|Reported by:||benward||Owned by:||benward|
Currently—with object caching enabled (APC, in this case)—changing the name of the network in Super Admin: Options does not stick; the old name persists until the cache is cleared.
This is because the network named is retrieved from ms-load.php:get_current_site_name(), which pulls the network name from a ':current_site_name' cache key. However, the options (and all other instances) only save/invalidate the ':site_name' cache key. When you save Site Options, ':site_name' is updated and ':current_site_name' is not.
':current_site_name' is only used by the get_current_site_name() function. If ':current_site_name' is not set, the function pulls ':site_name' as the first fallback (also from the cache.) ':current_site_name' is therefore redundant, and maintains old data in the cache when options are saved.
This patch simply removes the ':current_site_name' cache lookup from get_current_site_name(), goes straight to ':site_name' instead, and in the event that it has to look-up from the database, caches ':site_name'.
Site Name appears to be the only affected field.
Change History (4)
- Keywords has-patch added; caching multi-site options site_name current_site_name removed