After conferring with Sitecore Support, it was their determination as well that the
Sitecore.Caching.CachePriority enum type has not been used since Sitecore 5.1.
Additionally, note that the related
Caching.Priority config setting is not even taken into account, and the
CachePriority.Normal is always returned (see @grg's answer or the decompiled source of the
From Sitecore Support in regards to the eviction flow:
In the current caching implementation, the eviction happens when a new key should be added, but there is not enough space left to add it.
When a new entry is added to the cache, the CheckSize method checks if there is enough space. If not, cache entries should be evicted or the whole cache should be cleared.
The Scavenge method performs eviction (or cleanup, if necessary). Note: as a result, the scavenge is not performed in case the cache size limits are disabled.
By default, the DefaultScavengeStrategy is used. This strategy does not take the priority of the cache or cache entries into the account. There are no other strategies available by default. Therefore, it looks like the CachePriority is obsolete as well as the related properties.
We have registered a bug related to the unused CachePriority enum and the related Caching.Priority configuration setting (reference number 93317).
Sitecore Support later clarified the nature of the bug:
The bug is related to the fact that there are unused configuration settings, enums and properties.
It is not specified if this functionality should be deleted or included in the eviction logic. Therefore, hat's up to developers to review it and decide if the cache priority can be used to improve the eviction functionality (for example, by adding a new scavenge strategy) or there are some potential drawbacks and this functionality should be deprecated.
Hopefully, the developers at Sitecore will see this post and realize that there is value in either adding in the missing cache priority logic and/or making it possible to write custom scavenge strategies.