JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q54839F
  • License MIT

Cache solutions for Loopback

Package Exports

  • loopback-cache

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (loopback-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

loopback-cache

Build Status Coverage Status

Cache solutions for Loopback.

How to use

Install

npm install loopback-cache --save

Config

To load the mixins.

# model-config.json
{
  "_meta": {
    ...
    "mixins": [
      ...
      "loopback-cache/mixins",
      ...
    ]
  },
  ...
}

To use the redis backend, setup a model using the redis connector and use the mixin CacheModel with the model. The TTL is in seconds, see http://redis.io/commands/expire.

# The model JSON
{
  ...
  "mixins": {
    "CacheModel": {
      "backend": "redis",
      "ttl": 3600
    }
  },
  ...
}

To use the couchbase backend, setup a model using the couchbase3 connector and use the mixin CacheModel with the model. The TTL is in seconds usually but also has a special case, see http://docs.couchbase.com/sdk-api/couchbase-node-client-2.1.2/Bucket.html#touch.

# The model JSON
{
  ...
  "mixins": {
    "CacheModel": {
      "backend": "couchbase",
      "ttl": 3600
    }
  },
  ...
}

Git Summary

 project  : loopback-cache
 repo age : 3 months
 active   : 12 days
 commits  : 33
 files    : 14
 authors  :
    20  CCharlieLi   60.6%
    11  Makara Wang  33.3%
     2  fraserxu     6.1%