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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
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.