wp_cache_get before a query, and the group nobody sets

The object cache is per-request by default and persistent with a drop-in, and either way the cache group is what keeps two plugins from using the same key for different things.

$key   = 'sector_' . $sector_id;
$group = 'turkerdev_reports';

$rows = wp_cache_get( $key, $group );

if ( false === $rows ) {
    $rows = $wpdb->get_results( /* ... */ );
    wp_cache_set( $key, $rows, $group, 300 );
}

// and on a multisite, the group has to be declared global or it is
// silently prefixed per site:
// wp_cache_add_global_groups( array( 'turkerdev_reports' ) );

The multisite prefixing is invisible on a single site and produces a cache that appears not to work the moment the code runs on a network, which is a long afternoon. An expiry of zero means no expiry, which is right for something invalidated explicitly and wrong for anything else. Without a persistent backend all of this is still worth doing, because a page that queries the same thing four times becomes a page that queries it once.