Skip to content

Commit

Permalink
Merge pull request #57 from deains/fix-stale-while-revalidate
Browse files Browse the repository at this point in the history
Fix compliance with stale-while-revalidate
  • Loading branch information
Kevinrob authored Jun 17, 2016
2 parents f58c853 + d09b533 commit f30ded4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function __construct(
}

if ($staleWhileRevalidateTo === null && $values->has('stale-while-revalidate')) {
$this->staleWhileRevalidateTo = new \DateTime('+'.$values->get('stale-while-revalidate').'seconds');
$this->staleWhileRevalidateTo = new \DateTime(
'@'.($this->staleAt->getTimestamp() + (int) $values->get('stale-while-revalidate'))
);
} else {
$this->staleWhileRevalidateTo = $staleWhileRevalidateTo;
}
Expand Down

0 comments on commit f30ded4

Please sign in to comment.