function __invoke(callable $callback) {
if ($this->readFromCache($cached)) {
- header("X-Cache-Hit: $this", false);
call_user_func_array($callback, $cached);
} else {
- header("X-Cache-Miss: $this", false);
$this->enqueue($callback);
}
return $this;
$args = $this->args;
unset($args["fresh"]);
ksort($args);
- return sprintf("github:%s:%s:%s", $this->api->getToken(), $this,
+ return sprintf("%s:%s:%s", $this->api->getToken(), $this,
new QueryString($args));
}
}
$now = time();
$ltl = $ttl - ($now - $set);
- header("X-Cache-Times: ltl=$ltl,now=$now,set=$set,ttl=$ttl", false);
if ($ltl >= 0) {
if ($update) {
$item->time = time();