public function generateCachedFile($type, $fileName)
    {
        $isValid = $this->validateCache($fileName);
                
        // If the cache isn't valid, we build the cache
        $result = $isValid;
        if (!$isValid) {
            $result = $this->buildFileCache($type, $fileName);
        }
        
        // If the cache is valid, load the file
        if ($result) {
            $hash = $this->getHash($fileName);
            return $this->cachedFiles[$hash];
        }
        
        return false;
    }