{"id":44936,"library":"feathers-redis-cache","title":"feathers-redis-cache","description":"Redis caching hooks for Feathers.js services, version 1.2.2. This package provides before/after hooks to cache API responses in Redis, supporting per-route and group-based cache purging. It is a fork of feathers-hooks-rediscache with simplified API, pagination support, custom cache key generation, and configurable logger. Designed for HTTP endpoints in clustered Feathers applications where in-memory caching would be duplicated across nodes. Release cadence is low; last release was a patch update. Alternatives include feathers-hooks-rediscache (original, less feature-rich).","status":"active","version":"1.2.2","language":"javascript","source_language":"en","source_url":"git://github.com/sarkistlt/feathers-redis-cache","tags":["javascript","feathers","feathersjs","feathers-hooks","redis","feathers-cache","feathers-redis-cache","cache"],"install":[{"cmd":"npm install feathers-redis-cache","lang":"bash","label":"npm"},{"cmd":"yarn add feathers-redis-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add feathers-redis-cache","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides Redis client for caching operations","package":"redis","optional":false}],"imports":[{"note":"CommonJS require is supported but TypeScript/ESM is preferred. Ensure Node.js version supports ESM.","wrong":"const { before } = require('feathers-redis-cache')","symbol":"before","correct":"import { before } from 'feathers-redis-cache'"},{"note":"The exported hook is named 'after', not 'afterCache' or 'cacheAfter'.","wrong":"import { afterCache } from 'feathers-redis-cache'","symbol":"after","correct":"import { after } from 'feathers-redis-cache'"},{"note":"Used in after create/update/patch/remove hooks to clear the cache group.","wrong":"","symbol":"purge","correct":"import { purge } from 'feathers-redis-cache'"}],"quickstart":{"code":"import { before, after, purge } from 'feathers-redis-cache';\nimport feathers from '@feathersjs/feathers';\nimport express from '@feathersjs/express';\n\nconst app = express(feathers());\n\napp.use('/messages', service);\n\napp.service('messages').hooks({\n  before: {\n    find: [before()],\n    get: [before()]\n  },\n  after: {\n    find: [after({ expiration: 3600 })],\n    get: [after({ expiration: 3600 })],\n    create: [purge()],\n    patch: [purge()],\n    update: [purge()],\n    remove: [purge()]\n  }\n});\n\napp.listen(3030);","lang":"typescript","description":"Basic Feathers.js app with Redis caching for find/get and cache purging on mutations."},"warnings":[{"fix":"Update code to not use removed options; pass expiration in after({ expiration: seconds }).","message":"The fork changed the API: removed options like 'parseNestedRoutes', 'removePathFromCacheKey', 'defaultDuration', 'immediateCacheKey'. Custom expiration must be passed in after hook options.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Set expiration in after hook options instead of before hook.","message":"Removed 'hookCache' option; custom expiration no longer set in before hook.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure config.json uses 'redis' key instead of 'redisCache'.","message":"Removed 'redisCache' from config; use standard 'redis' config key or default Redis config.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Migrate to 'feathers-redis-cache' and update hook imports.","message":"The original package 'feathers-hooks-rediscache' is deprecated in favor of this fork.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Be aware that caching varies by URL and query string; plan purge strategy accordingly.","message":"Cache keys are generated in before hook; query params affect caching. Different params produce different cache keys.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use only over HTTP; consider alternatives for socket-based caching.","message":"Not tested with sockets; intended for HTTP usage only.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.2.2':12 'across':71 'altern':83 'api':20,45 'applic':62 'base':31 'before/after':16 'cach':4,6,19,32,49,67,103,107,108 'cadenc':74 'cluster':60 'configur':53 'custom':48 'design':55 'duplic':70 'endpoint':58 'feather':2,40,61,86,95,98,102,105 'feathers-cach':101 'feathers-hook':97 'feathers-hooks-rediscach':39,85 'feathers-redis-cach':1,104 'feathers.js':9 'feathersj':96 'featur':92 'feature-rich':91 'fork':37 'generat':51 'group':30 'group-bas':29 'hook':7,17,41,87,99 'http':57 'in-memori':64 'includ':84 'javascript':94 'key':50 'last':77 'less':90 'logger':54 'low':76 'memori':66 'node':72 'origin':89 'packag':14 'pagin':46 'patch':81 'per':26 'per-rout':25 'provid':15 'purg':33 'redi':3,5,23,100,106 'rediscach':42,88 'releas':73,78 'respons':21 'rich':93 'rout':27 'servic':10 'simplifi':44 'support':24,47 'updat':82 'version':11 'would':68","created_at":"2026-06-07T12:52:34.487852+00:00","updated_at":"2026-06-07T12:52:34.487852+00:00","problems":[{"fix":"Run npm install feathers-redis-cache or yarn add feathers-redis-cache.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'feathers-redis-cache'"},{"fix":"Use named import: import { before } from 'feathers-redis-cache'.","cause":"Incorrect import: likely imported as default instead of named export.","error":"TypeError: before is not a function"},{"fix":"Start Redis server or configure redis host/port in config/default.json under 'redis' key.","cause":"Redis server is not running or config not set.","error":"Redis connection error: connect ECONNREFUSED 127.0.0.1:6379"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"git://github.com/sarkistlt/feathers-redis-cache","github":"git://github.com/sarkistlt/feathers-redis-cache","docs":null,"changelog":null,"pypi":null,"npm":"feathers-redis-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}