Using custom Cache folder

Hello all!

I am currently still using Flow version 6.3.0 and my system has (unfortunately) been pushed to the cloud. Thus, the cache folder (Data/Temporary) is also in the cloud. This has the big disadvantage that I have an extremely large latency due to the many IOs (a medium-large page up has 5000 (!) file accesses for me): about 4x larger than in my local DDEV system. Therefore I want to place the cache folder in a local (from server point of view) folder.

In the .htaccess I added the following line:
SetEnv FLOW_PATH_TEMPORARY_BASE /var/tmp/NeosFlowCache/

Now I flush the cache:

export FLOW_CONTEXT=Production
export FLOW_PATH_TEMPORARY_BASE=/var/tmp/NeosFlowCache/
php7.4 ./flow flow:cache:flush && php7.4 ./flow cache:warmup

The new cache folder is now being diligently filled. Now when I try to access my flow application, a 500 comes up: “… PHP Fatal error: Allowed memory size of 134.217.728 bytes exhausted …” - So it only has 134 MB of PHP memory - PHPInfo however says 1024 MB is available (as set in the same .htaccess-file).

Does anyone have any ideas on how I can move forward at this point?

Thank you very much!

Best regards,


Hi, did you also adjust the memory limit for the PHP CLI, as this is a different setting?

Btw. you can also check whether it would help to use the database for certain caches. The PDOBackend for the Content and Routing caches for example.

Dear Sebastian,

I thank you very much for your prompt reply. I asked my hoster to increase the ML for PHP CLI. However, I do not understand, why this behavior comes, when I change the cache folder - the CLI memory limit should be same - independet of the folder, isn’t it?

The limit is independent, but when you choose a new folder, Flow has to rebuild a lot of caches which simply needs more than 128MB during the first run.