Hello, I've got a quick question regarding how the Tags are stored within a cache. Let's say there are lots of cached objects tagged the same way like "Men", "Shoes", "Sandals" (actually are categories). I've noticed that Tags are strings so wouldn't it better to use something like category ID (integer value) as Tags instead of the whole text keeping them as short as possible to minimize used memory or Tags are actually stored as a single dictionary with references to it and the example I've mentioned above doesn't consume much memory on Tags?
Good point - currently we only maintain them as strings and since the strings are interned the overhead is maintaining the array of pointers. Internally we have a reverse index which only maintains them once - however we need to keep track of the tags just to return them if you need the whole cache item or to delete them from the index. However, we will definitely consider the enumeration approach as well.