public function getPlayerHtml($video_html)
    {
        $player_url = $this->getPlayerUrl($video_html);

        $cache_path = sprintf('%s/%s', $this->storage_dir, md5($player_url));

        if (file_exists($cache_path)) {
            $contents = file_get_contents($cache_path);
            //return unserialize($contents);
        }

        $contents = $this->curl($player_url);

        // cache it too!
        file_put_contents($cache_path, serialize($contents));

        return $contents;
    }
public function getPlayerHtml($video_html)
    {
        $player_url = $this->getPlayerUrl($video_html);

        $cache_path = sprintf('%s/%s', $this->storage_dir, md5($player_url));

        if (file_exists($cache_path)) {
            $contents = file_get_contents($cache_path);
            //return unserialize($contents);
        }

        $contents = $this->curl($player_url);

        // cache it too!
        file_put_contents($cache_path, serialize($contents));

        return $contents;
    }
public function getPlayerHtml ( $ video_html ) { $ player_url = $ this -> getPlayerUrl ( $ video_html ) ; $ cache_path = sprintf ( '%s/%s' , $ this -> storage_dir , md5 ( $ player_url ) ) ; if ( file_exists ( $ cache_path ) ) { $ contents = file_get_contents ( $ cache_path ) ; //return unserialize($contents); } $ contents = $ this -> curl ( $ player_url ) ; // cache it too! file_put_contents ( $ cache_path , serialize ( $ contents ) ) ; return $ contents ; }
Do not redownload player.js everytime - cache it
Do not redownload player . js everytime - cache it