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

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free 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