This course came at the perfect time. I’ve recently gotten back into Rails after an 18-year hiatus, and this was a perfect refresher and shows just how much you can accomplish with Rails right out of the box.Garrett Winder
Next up, let’s take a look at Solid Cache, the sibling to Solid Queue and one of the three Solid gems that are now default in Rails 8.
As you might expect, Solid Cache powers the caching system in Rails applications.
Looking at the schema file, we see that Solid Cache has a much simpler structure compared to Solid Queue—it consists of just one table where all cache entries are stored. While the architectural decisions behind Solid Cache have been discussed in conference talks, for now, let’s focus on how it’s configured and used.
Opening config/cache.yml, we see the default cache settings:
This brings us back to database.yml, where Rails automatically separates each component into its own SQLite database:
This separation improves performance and concurrency, ensuring cache operations don’t interfere with database writes or job processing.
There is a key difference in how caching works between development and production:
This means that in development:
However, if you want to use Solid Cache in development, you can manually enable it by following setup scripts.
Solid Cache provides several powerful features that make it a robust alternative to Redis or Memcached:
I’m excited that Solid Cache is now a Rails default because it:
With Solid Queue handling background jobs and Solid Cache managing fast, secure storage, Rails 8 is making it easier than ever to build scalable, production-grade applications.
In the next video, we’ll look at Solid Cable, which powers WebSocket messaging.