Nette app without cache (No temp folder at all)
- dkorpar
- Member | 135
I'm using nette with gearman for my worker app. Once started worker runs for
long time (weeks) until it's updated or whatever. Caching configuration and
containers for services is not needed because it's only one step more every
time I redeploy up I have to delete the cache folder, and since this is script
that runs once for a long time (not classic web request/response) there's no
real benefit of this.
So my question is what would be the fastest way to avoid this?
Last edited by dkorpar (2016-03-10 12:24)
- Michal Vyšinský
- Member | 608
Hi,
you can use DevNullStorage
I am not completely sure how to do it in config.neon, but something like this should be a way how to avoid creation of ‘temp/cache’ folder completely:
remove ‘cache’ extension in bootstrap.php (before calling
$configurator->createContainer()
):
unset($configurator->defaultExtensions['cache']);
register service in configuration neon file to aviod missing service exceptions:
services:
- Nette\Caching\Storages\DevNullStorage
Last edited by Michal Vyšinský (2016-03-10 12:53)
- dkorpar
- Member | 135
So I've tried with
unset($configurator->defaultExtensions['cache']);
$container = $configurator->createContainer();
and
cacheStorage: Nette\Caching\Storages\DevNullStorage
but Nette.Configurator folder is still created with container files. Maybe it
has to be created, but I want to make sure that at least it will be overwritten
on every call?
I'm getting closer to just delete the temp/cache folder on bootstrap.php before
creating container, although it's not the best solution
Last edited by dkorpar (2016-03-10 14:30)