protected function getCacheFilePath($subdir, $filename, $forceOriginalFile = false, $hashed_options = null)
    {
        $path = $this->getCachePath($subdir);

        $safe_filename = preg_replace("[^:alnum:\-\._]", "-", strtolower(basename($filename)));

        // Keep original safe name if no tranformations are applied
        if ($forceOriginalFile || $hashed_options == null) {
            return sprintf("%s/%s", $path, $safe_filename);
        } else {
            return sprintf("%s/%s-%s", $path, $hashed_options, $safe_filename);
        }
    }