We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cache sub directories

I can specify a cache directory with this code:


$cache = new Phalcon\Cache\Backend\File($frontCache, array(
     "cacheDir" => "../app/cache/"
));```

But, having lots of cache items, it will add lots of files to this directory. So, is it possible to make Phalcon automatically generate sub directories to store the cache files?

What I'm asking is similiar to what Zend 1 does with the "hashed_directory_level" parameter:
https://framework.zend.com/manual/1.12/en/zend.cache.backends.html


39.3k
Accepted
answer

Yeah we need to look into that since sooner or later we will end up with the no more files allowed i.e. max files per folder.

Could you please open a NFR in Github so that we can address this?

Thanks!

Please provide a link to github if this was done:-) Thanks