Socket
Socket
Sign inDemoInstall

backbone-cache-sync

Package Overview
Dependencies
26
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    backbone-cache-sync

A server-side adapter that caches Backbone.fetch requests using Redis.


Version published
Maintainers
2
Install size
2.29 MB
Created

Readme

Source

Backbone Cache Sync

An implementation of Backbone.sync that takes the cache: true option. This will store the response in Redis keyed by the url. The next request to that url with cache: true will fetch the cached data from Redis instead of making a GET request. Requires backbone-super-sync.

Example

REDIS_URL = "redis://redistogo:t0k3n@crestfish.redistogo.com:1337/";
DEFAULT_CACHE_TIME = 3600;
NODE_ENV = "production";
var Backbone = require('backbone');
Backbone.sync = require('backbone-super-sync');
cacheSync = require('backbone-cache-sync');
cacheSync(Backbone.sync, REDIS_URL, DEFAULT_CACHE_TIME, NODE_ENV);

model = new Backbone.Model({id: 'bar'});
model.urlRoot = '/foo';
model.fetch({cache: true});

Contributing

Please fork the project and submit a pull request with tests. Install node modules npm install and run tests with make test

License

MIT

Keywords

FAQs

Last updated on 08 Mar 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc