Skip to content

extension-utils: clarify policy cache invalidation ownership #147

Open

Description

@joggienl

Both the Policies endpoint and Coolify deployments can register policy-cache invalidation hooks, and both use DIRECTUS_POLICY_CACHE_INVALIDATION_ENABLED.

When both extensions are installed in the same Directus instance, the shared environment variable cannot disable invalidation for only one of them.

Clarify ownership and avoid duplicate registration. Possible directions include central/shared registration, idempotent registration, or extension-specific enable flags.

Follow-up surfaced by #144.

Activity

  1. remihuigen commented on Sep 28, 2026

    @remihuigen
    Member

    Impact is probably low - the worst cache scenario is that the same stuff is flushed twice

  2. remihuigen commented on Sep 30, 2026

    @remihuigen
    Member

    Im also not sure whether extensions in the same project, that all use the directus policy cache, actually share a cache instance.

    If the cache store is redis, then yeah probably (because they share a namespace).

    But if the cache store is memory (eg a js map is used), im not sure if that points to the exact same object, because the cache utility is imported separately from each extension, and the map is declared in the utility global scope. Not sure if all imported than share the same variable? 🤔

    Anyway, this needs further investigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpackage: extension-utilsChanges affecting @onderwijsin/directus-extension-utils

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions