DEV Community

Discussion on: Performance Best Practices: Running and Monitoring Express.js in Production

Collapse
 
adnanrahic profile image
Adnan Rahić

Thanks! I'm glad you liked it. I thought about adding more info about Nginx and Redis, but the article is already a 20min read so I decided to leave it for a future writeup. 😄

In short, with Nginx you cache HTML pages, while with Redis you cache API responses from e.g. databases, other APIs, services, etc. What I do is cache the object response I get from the database in Redis for a whole day. I only update the cache every 24h or when the resource is edited. The edit will trigger a cache refresh.

Hope that makes sense.