Uploaded image for project: '[Read Only] - CRISP'
  1. [Read Only] - CRISP
  2. CRISP-64

[Backport to v12] Let ResourceCacheResolvable to generate cache key

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.6.1

    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

              Unassigned Unassigned
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: