Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

WIP proposal to split into many adapters #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agutoli
Copy link

@agutoli agutoli commented Nov 26, 2021

This is a proposal to split this plugin into optional cache adapters.

Why?

  • It makes the package smaller.
  • It allows installing only necessary dependencies like ioredis, redis-lru.
  • More scalable to implement alternative cache servers without increasing package size.

WIP

This is a proposal only, not fully implemented.

@patrixr
Copy link
Owner

patrixr commented Nov 27, 2021

Good stuff, I like it ! 🚀

@stafyniaksacha has been migrating a whole bunch of Strapi things to Typescript, when that becomes more available the adapter packages could benefit from a typescript interface as well.

@stafyniaksacha
Copy link
Collaborator

I like the idea too :)

Just a small niptipping, can we rename "strapi-middleware-cache-mem-adapter" to something like "strapi-middleware-cache-in-memory-adapter" to avoid confusing with "memcached" ?

@derrickmehaffy
Copy link
Collaborator

I have some suggestions since we have lightly discussed making this a plugin for v4 (in which case the package would be renamed to strapi-plugin-cache)

Likewise since we (Strapi) use the strapi-provider-* syntax (for v4 they will actually be @strapi/provider-*) I would suggest we follow a similar syntax.

Other than that I totally think this is a fantastic idea. A fellow community member @MattieBelt is working on a search plugin that is planning to use this same structure.

(I might suggest hold off on merging this until we figure out how best to rewrite this for v4 though)

@stafyniaksacha
Copy link
Collaborator

Likewise since we (Strapi) use the strapi-provider-* syntax ...

👍 Totally agree

(I might suggest hold off on merging this until we figure out how best to rewrite this for v4 though)

May we start creating an RFC for this plugin ? (I plan to work again on this in one or two weeks)

@derrickmehaffy
Copy link
Collaborator

Likewise since we (Strapi) use the strapi-provider-* syntax ...

+1 Totally agree

(I might suggest hold off on merging this until we figure out how best to rewrite this for v4 though)

May we start creating an RFC for this plugin ? (I plan to work again on this in one or two weeks)

For sure, please feel free. I should be free to discuss later this week after the v4 stable release.

@stafyniaksacha
Copy link
Collaborator

Hello @agutoli !

I have implemented the provider system for the V4 release here: https://github.com/patrixr/strapi-middleware-cache/tree/feature/strapi-v4/packages

Please feel free to give your feedback!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants