DEV Community

Discussion on: A simple caching strategy for Node REST APIs, Part 1

Collapse
 
svenvarkel profile image
Sven Varkel

It seems that you're using URL as cache key, right? Things to be considered:

  • are the URL-s public? I.e circumstances changes when the URL-s are behind authentication because then you cannot send back the same responses to all users etc.
  • do all the parameters come in via URL? Are there any headers or anything that may differ between requests? Should these be considered?

What's your cache backend?

Collapse
 
vigzmv profile image
Vignesh M

Both of these considerations depend upon one's own project and what routes they want to cache. This example works best for data that only dependents on the URL and not any context like current user.