Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bookshelf-cache-redis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bookshelf-cache-redis

A robust, performance-focused caching solution for Bookshelf based on top of Redis.

  • 1.2.0
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Bookshelf Cache Redis

🔥 A robust, performance-focused caching solution for Bookshelf based on top of Redis.

Installation

$ cd myProject/
$ npm install bookshelf-cache-redis --save

Usage

import config from './knexfile';
import knex from 'knex';
import Bookshelf from 'bookshelf';
import redisCache from 'bookshelf-redis-cache';

const bookshelf = Bookshelf(knex(config));

bookshelf.plugin(redisCache);

You can pass the exact same parameters on the fetchCache and fetchAllCache methods as you will do with fetch and fetchAll. However, you need to specify an unique serial key for each request.


Car
 .forge(params)
 .fetchCache({
   serial: 'car_fetch',
   withRelated: ['engine']
 })
 .orderBy('-productionYear') // Same as .orderBy('cars.productionYear', 'DESC')
 .then(function (results) {
    console.log(results);
 });

Keywords

FAQs

Package last updated on 21 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc