Qache is a modular utility class for handling server side caching of Data.
Accelerated by OS Labs and developed by Nader Almogazy, Steven Du, Leo Crossman, and Evan Preedy
- Server-side caching implemented in one line:
const qache = new Qache({});
- Easy-to-use, modular caching methods, to get started...
qache.set(key, value)
thenqache.get(key)
- Full Suite of list methods, allowing users to create, read, update, and delete cache data on a per page, per category, or site-wide level.
- Lazy Invalidation! Optionally reset your cache after certain events if you can't figure out a way to maintain cache validity. Simply
qache.invalidate()
- Get diagnostics on your Cache, and see all it's contents!
qache.log()
- Cache Eviction Policies:
- timeToLive: Qache tracks when each node stored was last accessed. By default data has an infinite timeToLive, to change this, pass into your options object
{timeToLive: NumberInMilliseconds}
- maxSize: Qache tracks how many keys/nodes exist, and upon reaching it's max, will begin to evict older data in order to add new data. This property is always true, and defaults to 5 nodes. To change this property, pass into your options object
{maxSize: Number}
- LRU(default): Upon reaching max size, Qache will evict the Least Recently Accessed Node in cache
- LFU: Upon reaching max size, Qache will evict the Least Frequently Used Node in Cache, determined by tracking access counts of each node. To switch to this policy, pass into your options object
{evictionPolicy: "LFU"}
- timeToLive: Qache tracks when each node stored was last accessed. By default data has an infinite timeToLive, to change this, pass into your options object
All code changes happen through Github Pull Requests and we actively welcome them. To submit your pull request, follow the steps below:
- Fork the repo and create your branch from
master
. - If you've added code that should be tested, add tests.
- Be sure to comment on any code added.
- Ensure the test suite passes.
- Make sure your code lints.
- Issue a Pull Request!
- Clone this repo.
cd qache-app
- Run
npm install
npm start
2 spaces for indentation 80 character line length
A note on using the dev server: you must access the /graphql
route on port 8080.