Skip to content

How to exclude cache-related queries from the Queries tab in Laravel Debugbar? #1788

@nekooee

Description

@nekooee

Hi,

I'm using Laravel Debugbar with Laravel 11, and I noticed that cache lookups (e.g. select * from cache where key in (?)) are now shown in the Queries tab.

In previous versions, cache reads (especially when using the file cache driver) were not listed as queries. But now, even if the cache driver is set to file, a cache lookup is shown as a query — which makes it hard to distinguish real database queries from internal cache checks.

This affects how I measure and optimize database usage, as the total number of queries shown is inflated by cache lookups.

Is there a way to exclude cache-related queries from being recorded or shown in the Debugbar's query tab?
If not, would it make sense to add an option like exclude_cache_queries in the config?

Thanks in advance for any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions