Skip to content

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

Open
@bdickason

Description

@bdickason

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions