Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lightweight caching via redis to server to reduce mysql calls #11

Open
bdickason opened this issue May 30, 2017 · 0 comments
Open

Comments

@bdickason
Copy link
Member

Mysql calls are synchronous, slow, and expensive. Since our app is just serving a big bundle of json data, I propose the following:

  1. Install redis: http://redis.io
  2. When express receives a cache-able route (framedata, metadata, characterdata), call redis first with the url as the list and the version as the key within that list.
  3. Redis should return the cached json blob in one response. If the json blob doesn't exist, it should call our controller to generate the response via mysql, pass it through, and then store it in redis.

This is super, super simple and stupid caching, but should give us alot of speed and efficiency games for very little work.

I suspect we could use express middleware for this if we wanted: https://www.npmjs.com/package/express-redis-cache

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

No branches or pull requests

1 participant