Skip to content

Ability to manually clear in-memory cache #243

Open

Description

@aaricpittman

Is your feature request related to a problem? Please describe.

When in ldd mode, I would like to be able to manually clear the in-memory cache rather than wait for the expiration.

Describe the solution you'd like

The ability to call client.clear_cache or store.clear_cache or something to that effect which would ultimately call LaunchDarkly::ExpiringCache#clear.

Describe alternatives you've considered

Given the encapsulation of the cache, the only option currently seems to be to close the current client and initialize a new one.

Activity

  1. keelerm84 commented on Dec 29, 2023

    @keelerm84
    Member

    Good morning and thank you for reaching out.

    There has some been discussion recently about the behavior of the in memory cache within the SDKs. Would you mind telling me a bit more about your use case so we can capture that need in future discussions?

  2. aaricpittman commented on Jan 2, 2024

    @aaricpittman
    Author

    Sure,

    The client used by our Rails app is instantiated with use_ldd: true. We have code in our app that was intended to clear the in-memory cache. There was some confusion and it was believed that it could be cleared calling flush on the client. While looking into another issue I realized that flush wasn't clearing the cache as originally thought and was looking for a way to actually clear it without extending SDK.

  3. added a commit that references this issue on May 7, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions