public function getCacheFile($filename, $actual = false, $mkdir = false)
    {
        $path = array();

        // Getting the length of the filename before the extension
        $parts = explode('.', $filename);
        $len = strlen($parts[0]);

        for ($i=0; $i<min($len, $this->prefixSize); $i++) {
            $path[] = $filename[$i];

        }
        $path = implode('/', $path);

        if ($mkdir) {
            $actualDir = $this->getActualCacheDirectory() . '/' . $path;
            $this->mkdir($actualDir);
        }

        $path .= '/' . $filename;

        if ($actual) {
            return $this->getActualCacheDirectory() . '/' . $path;
        } else {
            return $this->getCacheDirectory() . '/' . $path;
        }
    }