'Phalcon 4.x creates multiple folders to store cached data. What is the benefit of having recursive and multiple folders?

$hash = '123456789';
$fileName = "test.{$hash}.html";

the final directory structure will be like following.

te/st/.1/23/45/67/test.123456789.html

it simply breaks down the file name in to directories of two characters leaving the last 2 chars from the path test.123456789



Solution 1:[1]

To prevent too many files in one folder error. See https://docs.phalcon.io/4.0/en/cache#stream as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ruud Boon