MAINT: use a structure as cache buckets
Merge pull request #5014 from juliantaylor/cache-struct

MAINT: use a structure as cache buckets