Skip to content

[RFC]: Service Caching: export cacheClient  #7004

@cannikin

Description

@cannikin

Summary

@Josh-Walker-GM asked a question about doing something with the cache during Service Caching Discord office hours, which isn't currently possible. BUT, if we exported the cache client instance that we're using in MemcachedClient and RedisClient, then users could do whatever they wanted (as long as the underlying client itself supports it).

Motivation

This unlocks the full potential of memcached and Redis and doesn't just limit the API to the get and set functions that we expose.

Detailed proposal

Export the initialized client from api/src/lib, the one that's given to createCache():

export const { cache, cacheFindMany } = createCache(client, {
  logger,
  timeout: 500,
})

Proposed:

export const { cache, cacheFindMany, cacheClient } = createCache(client, {
  logger,
  timeout: 500,
})

cacheClient() itself would need to be updated to export the client after initialization.

Are you interested in working on this?

  • I'm interested in working on this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions