Feb 9, 2024
0
Level 3
PHP Debug bar memory issue with redis
Hi,
Anyone has an explanation for strange behavior that I am experiencing with laravel-debugbar. To make it short I have a LengthAwarePaginator that is beign cached to redis. When it's cached debugbar shows 50mb of RAM. When we skip the cache step and do not cache at all and rather make 50 queries on every page load it is down to 22MB.
Can someone explain this to me? Is there something I am missing. This is just a part of the code which stores data to cache - long cache name and a service which returns the paginator. Sorry for formatting.
$coloredProducts = Cache::remember('eloquent_colored_products_for_transformation_for_category_id_' . $category->id . '_eshop_id_' . eshop()->eshopService()->getId() . ' _for_page_' . $fromPage . '_for_sort_' . (request()->sort ?? 'none') . '_for_query_' . $query . '_for_cep_' . implode("_", $cep->toArray()), config('cache.durations.five_minutes'), function () use ($cep, $category, $hiddenColoredProductIds, $query) {
return $this->coloredProductsService->getColoredProductsForEligibleCategoriesWithQueryFilterOptimizied($cep, $category, $hiddenColoredProductIds, $query);
});
Thank you very much
Please or to participate in this conversation.