Change cache directory in Symfony

This task is really simple. You can achieve it from Kernel.php, getCacheDir method:

public function getCacheDir()
    {
//        return $this->getProjectDir().'/var/cache/'.$this->environment; //Any location on your server
        return '/dev/shm/'.$this->environment; //This will cache in RAM
    }

Leave a Reply

Your email address will not be published. Required fields are marked *