Though it is very easy to implement a caching server by using the
GET operations, the solution provided here takes advantage of the advanced memory optimization feature in Redis. We will look into a simple solution and then dive into the optimization problem to reduce memory usage.
If the data to be cached is small and in the range of a few megabytes, we can use a single server with a single Redis instance. In this case, the
GET commands are sufficient. For instance, the web page to cache takes the URI as a parameter and generates the page. Then, we store the page contents as a value to a unique key. In this case, instead of storing URI as the key, we can use the hash of URI. ...