Page MenuHomePhabricator

Support key coalescing hints in BagOStuff/WANObjectCache makeKey()/makeGlobalKey()
Open, LowPublic

Description

WANCache uses mcrouter key coalescing internally for helper keys. It would be nice to easily expose hints to callers.

Maybe something like:

// Make keys that will go on the same server if possible
$keyA = $cache->makeKey( 'collection', $id, [ 'attributeA' ] );
$keyB = $cache->makeKey( 'collection', $id, [ 'attributeB' ] );
$keyC = $cache->makeKey( 'collection', $id, [ 'attributeC' ] );