I found this great resource that shows us the importance of Caching and its use in enhancing the performance of our project.
- What is caching
A common pain point in applications is optimizing and reducing the number of trips you have to take to the database. Say you have an e-commerce admin dashboard. Maybe you have a page that displays all inventory — every product, associated category, vendors, and more. A single page like this may perform dozens of calls to your database before the page can even display any data. If you don't think about how to handle this, your application can quickly become slow and costly.
One option to reduce the number of times you have to go to the database is through caching. Caching allows you to store specific data in application memory so that next time that query is hit, you already have the data on hand and won't have to go back to the database for it. Keep in mind, this is different from browser caching, which is user-based. This article covers application caching, which happens at the application level and cannot be cleared by the user.
Laravel has robust built-in functionality https://laravel.com/docs/9.x/cache that makes caching a breeze.
Let's see it in action!
Visit the source and learn about Planet Scale MySQL and use caching :-
https://planetscale.com/blog/introduction-to-laravel-caching
- https://www.cloudways.com/blog/integrate-laravel-cache/
- https://kinsta.com/blog/laravel-caching/
- https://vegibit.com/laravel-cache-tutorial/
- https://www.codecheef.org/article/basic-usage-of-cache-in-laravel
- https://www.ultimateakash.com/blog-details/ISxAYGAKYAo=/How-To-Use-Laravel-Cache-for-Query-Caching-2020.
- https://www.youtube.com/watch?v=-NOOqIYEFwc (https://github.com/codewithdary/laravel-cache)
- https://ashallendesign.co.uk/blog/an-introduction-to-caching-in-laravel
I hope you enjoyed the code as much as I enjoyed sharing it with you.
Top comments (0)