You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using nginx cache with module ngx_cache_purge.
Does redis cache (with nginx with module srcache) has advantages over the nginx cache?
What are they?
The text was updated successfully, but these errors were encountered:
DeeKey
changed the title
What are advances of srcache over nginx cache?
What are advantages of redis cache over nginx cache?
Dec 12, 2023
There are several advantages of using Redis cache over the default NGINX cache:
Redis, being in memory cache, can serve requests faster (though we can mount NGINX cache in TMPFS which stays in RAM)
Redis offers various eviction policies, letting you control how and when data is removed from the cache. This is more flexible compared to NGINX's caching mechanism.
If you are building a distributed system, a single Redis instance can serve multiple NGINX instances running on different servers (similar thing can be achieved by having an NFS mount of the NGINX cache directory, but not that efficient)
In Redis cache, you can purge pattern-based URLs all at once in a single request, e.g. https://example.com/category/* but the same is not possible in NGINX cache (as I remember) and you have to either send multiple requests to clear all cached pages matching that pattern individually, or clear the entire cache.
In my setup NGINX cache is in TMPFS (/dev/shm). But the biggest problem with this setup is slow delete of cache during post editing.
Thus I hope that pattern based purging might help me to speed up the purging process!
I am using nginx cache with module ngx_cache_purge.
Does redis cache (with nginx with module srcache) has advantages over the nginx cache?
What are they?
The text was updated successfully, but these errors were encountered: