May 2025
Intermediate to advanced
270 pages
6h 55m
English
For our next step, you will improve the performance of the films#index endpoint in the API by implementing your own caching. As always, you can hit the endpoint in api/v1/films to see the current state. Do exactly that and take a look. You should get something like this:
| | Started GET "/api/v1/films" for ::1 at 2023-01-21 10:55:23 -0500 |
| | Processing by Api::V1::FilmsController#index as HTML |
| | Film Load (12.5ms) SELECT `films`.`id`, `films`.`title`, |
| | `films`.`updated_at` FROM `films` |
| | ↳ app/controllers/api/v1/films_controller.rb:7:in `map' |
| | Completed 200 OK in 159ms |
| | (Views: 8.0ms | ActiveRecord: 20.2ms (1 query, 0 cached) | GC: 47.6ms) |
It’s not terrible, but it certainly could ...
Read now
Unlock full access