Uploaded image for project: 'CRISP'
  1. CRISP
  2. CRISP-64

[Backport to v12] Let ResourceCacheResolvable to generate cache key

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.1
    • Similar issues:

      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wko Woonsan Ko
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: