How to cache expressjs response

How to cache a response that has been genereated using the expressjs route. This route has a lot of access to the database, and there are very few changes to it. Is there a node avaialble module.

thanks

+4
source share
1 answer

connect-cache should do the trick. Add this to your application as middleware.

var connect_cache = require('connect-cache'); app.use( connect_cache({rules: [{regex: /.*/, ttl: 60000}]}) ); 
+4
source

Source: https://habr.com/ru/post/1490341/


All Articles