code: protected String generateCacheKeyForTheRequest(HttpServletRequest request) {
          StringBuilder cacheKey = new StringBuilder();
          cacheKey.append(request.getRequestURI());
          String[] keyAttributes = this.cacheKeyFormat.split(",");
          for (String attr : keyAttributes) {
              String keyAttr = attr.trim().toLowerCase();
              if (keyAttr.equalsIgnoreCase("queryString") && request.getQueryString() != null) {
                  cacheKey.append("+").append(request.getQueryString());
              } else if (keyAttr.startsWith("header=")) {
                  cacheKey.append("+").append(request.getHeader(keyAttr.substring(7).trim()));
              } else if (keyAttr.startsWith("parameter=")) {
                  cacheKey.append("+").append(request.getHeader(keyAttr.substring(9).trim()));
              }
          }
          return cacheKey.toString();
      }
docs: Generate the cache key for the specific request by using the cacheKeyFormat init param
  You can specify comma separated list of attributes that you want to use to build the cache key.
  URI is by default part of the cache key. Using cacheKeyFormat params you can optionally include following details.
  - queryString
  - specific header value
  - specific request parameter value
  
  Example cacheKeyFormats
  - "queryString"
  - "header=Content-Type, header=Vary"
  - "parameter=format, parameter=id, header=Vary"
  
  @param request HttpServletRequest
  @return key generated Cache key as per the rule