12 Caching auth sessions
Before you begin: Join our book community on Discord
Give your feedback straight to the author himself and chat to other early readers on our Discord server (find the "rust-web-programming-3e" channel under EARLY ACCESS SUBSCRIPTION).
While our authentication sessions work, we might as well get more control over them, and explore the concept of caching at the same time. We will do this by embedding our own Rust code directly in a Redis database, so we can perform a range of checks and updates in one call to the cache as opposed to making multiple calls to a database. Caching is a great tool to add to your belt, enabling you to reduce the time and resources used to serve data. In this chapter we cover the following:
What caching is
Setting up Redis
Building a Redis module in Rust
Building a Redis client in Rust
Connecting our cache to our servers
By the end of this chapter, you will be able to build custom caching functionality...