#Laravel Tip Don't let database queries slow you down. Use Laravel's cache facade to cache data temporarily, reducing database queries.
6
8
115
5K
48
Download Image
@laravelbackpack What about pagination cache?
@laravelbackpack rememberForever is the best hahhaha
@laravelbackpack $value = Cache::flexible('users', [5, 10], function () { return DB::table('users')->get(); });
@laravelbackpack Tip: Use the "flexible" to cache items that change frequently
@laravelbackpack A very bad example. Get all records without pagination from the database and put them in the cache? Let's say there are 25 million records in the table... That's it. Goodbye RAM.