Redis cache with an entity with two identifiers

I have a cacheable POCO which has an ID but also has a second identifier e.g. its UPC. The entity is fetched by either depending on the access into the system. e.g. web may request using ID whereas API might use UPC

Wondering how I can best handle this with servicestack + redis caching. At the moment I am caching twice and invalidating both during save.

Yeah either cache a reference to the key or cache twice. This earlier answer gives some background info on storing references with Redis:

1 Like

Awesome post thanks!