Skip to content

cache: shared + max_items/max_size mutually exclusive #1035

@mjvankampen

Description

@mjvankampen

Environment info:

KrakenD version: 2.10.2

From the documentation it would seem that you can set both share and max_items + max_size. But there are mutually exclusive in json so the example config below does not work:

{
    "backend": [{
      "url_pattern": "/url-to-cache",
      "host": ["http://host-to-cache.example.com"],
      "extra_config": {
        "qos/http-cache": {
          "@comment": "Allow up to 100 cache entries or ~128MB (bytes not set exactly)",
          "shared": false,
          "max_items": 100,
          "max_size": 128000000
        }
      }
    }]
}

The text at https://www.krakend.io/docs/backends/caching/#cache-configuration also seems to indicate otherwise:

To be released on open source on v2.10. The maximum number of bytes you allow the LRU cache to store for this cache bucket before starting to do evictions. This is not the total cache you allow to the system, but the number of bytes you reserve to this backend (or its shared neighbours). will store before starting to do evictions. When max_size is declared, you must declare max_items as well.

for my use case it does not matter too much but I would either update the docs, or the code, now they dont match!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions