Skip to content

Caddy: Site-level cache block ignores global storage and triggers default storage warnings #721

@everyx

Description

@everyx

Observed Behavior

  • Global cache block configures a storage provider (e.g., badger).
  • A site-level cache block is defined without any storage directives.
  • At runtime, Souin logs repeated warnings: “You’re running Souin with the default storage that is not optimized and for development purpose. We recommend to use at least one of the storages from https://github.com/darkweak/storages”.
  • In the effective configuration, the site-level badger (and other providers) appear as null in JSON.

Steps to Reproduce

  1. Add a global cache block with a storage provider:
    {
        cache {
            badger {
                path /tmp/badger
            }
        }
    }
  2. Add a site-level cache block without storage directives:
    example.com {
        cache {
            ttl 10s
        }
        reverse_proxy localhost:8080
    }
  3. Start Caddy and observe the warnings in the logs.

Actual Result

  • Site-level cache blocks without storage directives do not use the globally configured storage.
  • The system falls back to the default in-memory storage and logs warnings.

Expected Result

  • Site-level cache blocks should use the globally configured storage when no storage directives are provided at the site level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions