Cache category counts in DB