You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to do some general purpose caching from my Hapi based application. Since I already have Hapi configured with an open cache connection to Redis, I would prefer to just reuse that.
I confirmed the following will work from my request handler, but is this usage frowned upon since it is not a part of the public API?
Plugins are awesome and I'll be taking that route.
I created a fun little proof of concept plugin to teach myself how to create my own public plugins as well as how to call the cache client from within a plugin. I also learned a little about lab and server.inject in the process. https://npmjs.org/package/deadbox
I can see value in plugins when properly engineering an application and when sharing generic public plugins, but for private logic, wrapping a local node library can be an extra barrier to entry if somebody new to the framework is just trying to hack together something quickly. If you do add an interface for cache to the server, I suppose you'll need to prepend something to the key name to avoid key name collisions.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
featureNew functionality or improvementsupportQuestions, discussions, and general support
I need to do some general purpose caching from my Hapi based application. Since I already have Hapi configured with an open cache connection to Redis, I would prefer to just reuse that.
I confirmed the following will work from my request handler, but is this usage frowned upon since it is not a part of the public API?
The text was updated successfully, but these errors were encountered: