I have following large object (20KB) cached in memcache -
Product :
{
BasicInfo, //~5KB
SellerId, //int
CityId, //int
AdditionalInfo //~15KB
}
This is being accessed at multiple places-
- At some place, only sellerId or cityId is required.
- At some places, only basicInfo is required.
- At some places, whole object is required.
So we are fetching whole object unnecessarily in 1st and 2nd cases while we only require some bytes. Should I store these separately in memcache (only problem is I need to invalidate multiple keys on updation)?
Is there any better way to handle these cases?