DEV Community

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

Collapse
 
umaralam48 profile image
Mohd Umar Alam

Great read! Though would have really loved to know what all the configuration options in Nginx files do and how Nginx cache is different from Redis.

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.