Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
Description
At the moment, the cache key is generated by CacheableResourceServiceBroker.createCacheKey(), which is less extensible if a project needs to customize the cache key generation logic.
Our thematic project team met this problem. When the first request is made on the backend, they always include request_id query parameter. However, the cache key should omit request_id afterward to maximize caching and performance.
At the moment, they can override the resourceDataCache property but it's a lot of work to do just for cache key customization.
Therefore, I think it's a good improvement to add ResourceCacheResolvable#createCacheKey(...) and use it in CacheableResourceServiceBroker.createCacheKey() by default, with making org.onehippo.cms7.crisp.api.resource.AbstractResourceCacheResolvable implement the same logic by default.
Then a project like thematic can override a specific resource resolver with a custom cache key generation logic. For example, they can invoke {{ValueMap map = super.createCacheKey(...); }} first and modify some items there to return.
Attachments
Issue Links
- is a backport of
-
CRISP-61 Let ResourceCacheResolvable to generate cache key
- Closed