June 2024
Intermediate to advanced
456 pages
11h 34m
English
Active Record has a variety of caches that can be used to improve the performance of your Rails application.
The query cache[150] is a cache of SQL query results that lives for the duration of a Rails controller action. Since you’re likely running Rideshare in development mode where the query cache is not enabled, Rails Guides shows how to enable it.[151]
Toggle Caching in Dev | |
|---|---|
|
|
Run bin/rails dev:cache to toggle caching in development mode. |
Take the query TripRequest.where(rider_id: 1).first, which loads the rider’s first trip request.
After running it at the beginning of an action, the query and ...
Read now
Unlock full access