Skip to content

Pluggable cache strategies? #21

Open
@ivos

Description

@ivos

Have you considered supporting different cache strategies?

Now the cache is hard-coded in the library, but providing a cache interface (or using some standard, existing one) that people can implement and then plug in their own cache might be useful. Some ideas of what could be handy:

  1. No cache. In a multi-user app with data being frequently modified, one might want to fetch fresh data from the backend whenever a page is displayed.
  2. Time-to-live setting. Some data might have logical lifespan, after which it could be automatically expired and thus saving us clearing the cache imperatively. The timeout might be set on the global level, per-wrapped fn, or per call.

Alternatively, it might be beneficial to use some existing, proven library for caching (e.g. https://www.npmjs.com/package/lru-cache ?) instead of implementing own solution, and allowing the users to configure it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions