Simple API-caching middleware for Express/Node. A simple API response caching middleware for Express/Node using plain-English durations. Supports Redis or a built-in memory engine with auto-clearing. Because route-caching of simple data/responses should also be simple. Sometimes you need custom keys (e.g. save routes per session, or per method). We've made it easy! All req/res attributes used in the generation of the key must have been set previously (upstream). The entire route logic block is skipped on future cache hits so it can't rely on those parameters. Oftentimes it benefits us to group cache entries, for example, by collection (in an API). This would enable us to clear all cached "post" requests if we updated something in the "post" collection for instance. When sharing GET routes between admin and public sites, you'll likely want the routes to be cached from your public client, but NOT cached when from the admin client.

Features

  • Supports Redis or built-in memory engine with auto-clearing
  • Cache a route
  • Cache all routes
  • Use with Redis
  • Cache grouping and manual controls
  • Use with middleware toggle for fine control
  • Prevent cache-control header "max-age" from automatically being set to expiration age

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow apicache

apicache Web Site

Other Useful Business Software
Build Securely on AWS with Proven Frameworks Icon
Build Securely on AWS with Proven Frameworks

Lay a foundation for success with Tested Reference Architectures developed by Fortinet’s experts. Learn more in this white paper.

Moving to the cloud brings new challenges. How can you manage a larger attack surface while ensuring great network performance? Turn to Fortinet’s Tested Reference Architectures, blueprints for designing and securing cloud environments built by cybersecurity experts. Learn more and explore use cases in this white paper.
Download Now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of apicache!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Frameworks, JavaScript Web Development Software

Registered

2022-11-01