public function store( $id, $data, $attributes = array() )
    {
        // Generates the identifier
        $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes );

        // Purges the Registry Cache
        if ( isset( $this->registry[$filename] ) )
        {
            unset( $this->registry[$filename] );
        }

        // Deletes the files if it already exists on the filesystem
        if ( file_exists( $filename ) )
        {
            if ( unlink( $filename ) === false )
            {
                throw new ezcBaseFilePermissionException( $filename, ezcBaseFileException::WRITE, 'Could not delete existing cache file.' );
            }
        }

        // Deletes the data from APC if it already exists
        $this->backend->delete( $filename );

        // Prepares the data for filesystem storage
        $dataStr = $this->prepareData( $data );

        // Tries to create the directory on the filesystem
        $dirname = dirname( $filename );
        if ( !is_dir( $dirname )
             && !mkdir( $dirname, 0777, true ) )
        {
            throw new ezcBaseFilePermissionException( $dirname, ezcBaseFileException::WRITE, 'Could not create directory to store cache file.' );
        }

        // Tries to write the file the filesystem
        if ( @file_put_contents( $filename, $dataStr ) !== strlen( $dataStr ) )
        {
            throw new ezcBaseFileIoException( $filename, ezcBaseFileException::WRITE, 'Could not write data to cache file.' );
        }

        // Tries to set the file permissions
        if ( ezcBaseFeatures::os() !== "Windows" )
        {
            chmod( $filename, $this->options->permissions );
        }

        // Prepares the data for APC storage
        $dataObj = $this->prepareData( $data, true );
        $dataObj->mtime = @filemtime( $filename );
        $dataObj->atime = time();

        // Stores it in APC
        $this->registerIdentifier( $id, $attributes, $filename );
        if ( !$this->backend->store( $filename, $dataObj, $this->properties['options']['ttl'] ) )
        {
            throw new ezcCacheApcException( "APC store failed." );
        }

        // Returns the ID for no good reason
        return $id;
    }