-
Notifications
You must be signed in to change notification settings - Fork 0
Cache
ActiveORM cache working for a type of queries like: attribute lazyloading generated query and regular query)
Before caching all queries have to pass through a query transformator that actually responsible for query modification and collection metadata for further caching.
Query metadata like, what tables and what attributes used in the query, collect for future determination of cache segment.
Simple query workflow:
ActiveORM cache has 3 predefined cache segments.
Each segment specified through a segment feature (CacheSegmentFeature)
ActiveORM has 3 posible implementation for CacheSegmentFeature
CacheSegmentFeature specified for score calculation based on CacheContext parameters. A segment that has the highest score will be selected for cache storing
Each segment feature has scoreBasis that actually equals priority. Some of the segment features have score multiplier that might be applied if some condition is meet the requirement.
Name | scoreBasis | description |
---|---|---|
GenericTypeCacheSegmentFeature | 1 | Feature for most common segment used for all queries that is not meet the requirement for other segments |
ItemTypeCacheSegmentFeature | 2 | Feature used to dedicate segment for storing specific type. |
SingleItemCacheSegmentFeature | 3 | Feature that used for for a simple query were used only one type. |