---
title: "Discussion on \"Laravel 5: Use Query Caching to make your App really fast\" | Hashnode"
description: "Discussion on \"Laravel 5: Use Query Caching to make your App really fast\". I am currently rebuilding one of my oldest side projects, the Game Quotes Network. As a content-heavy application with a lot of stuff stored in the database it's not that easy to find the best balance between caching your site and delivering the most..."
url: "https://hashnode.com/posts/laravel-5-use-query-caching-to-make-your-app-really-fast/5c7bd2a8cf2519fc10e0a88c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Laravel 5: Use Query Caching to make your App really fast](https://hashnode.com/post/laravel-5-use-query-caching-to-make-your-app-really-fast?utm_source=hashnode&utm_medium=feed)

I am currently rebuilding one of my oldest side projects, the Game Quotes Network. As a content-heavy application with a lot of stuff stored in the database it's not that easy to find the best balance between caching your site and delivering the most...

Mar 3, 2019 · hashnode.com  
Read the article

-   [#laravel](https://hashnode.com/tag/laravel)
-   [#php](https://hashnode.com/tag/php)
-   [#caching](https://hashnode.com/tag/caching)
-   [#databases](https://hashnode.com/tag/databases)
-   [#php7](https://hashnode.com/tag/php7)

## Written by

[Kevin Woblick](https://hashnode.com/@Kovah)

@Kovah · Berlin, Germany

  
[View profile](https://hashnode.com/@Kovah)

Creator of Cloudhiker, LinkAce, Game-Quotes.com and more

## Responses 1

Markdown supported · ⌘↵ to post

[Kendo](https://hashnode.com/@krank1994)

[Mar 7, 2019](https://hashnode.com/posts/laravel-5-use-query-caching-to-make-your-app-really-fast/5c7bd2a8cf2519fc10e0a88c/comment/5c8089892ba874fd2ad8c78d)

Laravel framework has support cache. Why not using cache strategy for cache url and parameter?

[Kevin Woblick](https://hashnode.com/@Kovah)

[Mar 7, 2019](https://hashnode.com/posts/laravel-5-use-query-caching-to-make-your-app-really-fast/5c7bd2a8cf2519fc10e0a88c/comment/5c8089892ba874fd2ad8c78d#reply-5c80da83ac9636980e591ea8)

Thank you for your response. The problem with using the built-in cache is, that you have to manually implement it for each query.

Example:

```
$cache_key = '15_latest_users';
$cache_duration = 1440;
$users = Cache::remember($cache_key, $cache_duration, function(){
    return User::orderBy('created_at', 'DESC')->take(15)->get();
});
```

The first problem you can see is the cache keys itself. The Rememberable package works by using the hashed SQL statement as the cache key to prevent any collisions with cache keys that may be used elsewhere. Caching database queries manually is very hard.
