Someone says your app is slow, and you just need to add caching. But which kind of caching are they actually talking about?
In the latest episode of the No Compromises podcast, Aaron and I walk through the many layers of caching in a Laravel application, working from the outside in.
We start with edge caching in Cloudflare, move into the Cache facade for things like third-party API calls, and go all the way down to memoizing expensive in-request calculations with the once() helper.
We also make the case that a plain database table can be a perfectly valid caching strategy, and why the right question is not whether to cache, but what kind of caching actually fits the problem.
- 00:17 Why caching means different things to different people
- 02:04 Edge caching with Cloudflare explained
- 05:33 When a database table beats the
Cachefacade - 07:45 Memoization with the
once()helper - 09:19 Silly bit
And after listening, don't forget to subscribe to the podcast, so you don't miss future episodes.
Here to help,
Joel
P.S. Caching can also hide a problem instead of fixing it. If your app is slow, and you're not sure why, a code review will pinpoint the actual bottleneck.