Skip to content

Instantly share code, notes, and snippets.

@Geolim4
Created September 17, 2016 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Geolim4/993ce81d41d5fb2c2d52801d75de3142 to your computer and use it in GitHub Desktop.
Save Geolim4/993ce81d41d5fb2c2d52801d75de3142 to your computer and use it in GitHub Desktop.
    use phpFastCache\CacheManager;

    $cache = CacheManager::Memcached();

    // try to get from Cache first.
    $resultsItem = $cache->getItem("identity_keyword")

    if(!$resultsItem->isHit()) {
        $resultsItem->set($cURL->get("http://www.youtube.com/api/json/url/keyword/page"))->expireAfter(3600*24);
        $cache->save($resultsItem);
    }

    foreach($results as $video) {
        // Output Your Contents HERE
    }
@agengdp
Copy link

agengdp commented Mar 27, 2017

it should be expiresAfter(3600*24) with 's'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment