CacheBox is incredibly flexible and if you would like to create your own eviction policy, you can! Below are a set of easy steps on how to do this:
Create a simple CFC that implements the following class cachebox.system.cache.policies.IEvictionPolicy
or use our convenience abstract class and inherit from cachebox.system.cache.policies.AbstractEvictionPolicy
Create your own execute()
method that will evict items (We recommend looking at existing policies to get an insight on how to do this)
Use the policy instantiation path in your cachebox
provider properties
The below code is the code used to evict objects from cache
That's it folks! Very easily you can create your own eviction policies and use our built in indexers to just sort the elements in whatever way you like. If not, you can always do it yourself :)