X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Frender%2FPageCacheManager.php;h=fe74bf271bb08448f3f4a605f701fb3b8af0ec24;hb=f00600a283617286c813dc902fe3a2d66938b5fc;hp=97805c3524605bae07b30cb06b4c935517c8126c;hpb=ab4c170672c0679c5b8ebc6065e3ca2b13165f24;p=github%2Fshaarli%2FShaarli.git diff --git a/application/render/PageCacheManager.php b/application/render/PageCacheManager.php index 97805c35..fe74bf27 100644 --- a/application/render/PageCacheManager.php +++ b/application/render/PageCacheManager.php @@ -2,6 +2,7 @@ namespace Shaarli\Render; +use DatePeriod; use Shaarli\Feed\CachedPage; /** @@ -49,12 +50,21 @@ class PageCacheManager $this->purgeCachedPages(); } - public function getCachePage(string $pageUrl): CachedPage + /** + * Get CachedPage instance for provided URL. + * + * @param string $pageUrl + * @param ?DatePeriod $validityPeriod Optionally specify a time limit on requested cache + * + * @return CachedPage + */ + public function getCachePage(string $pageUrl, DatePeriod $validityPeriod = null): CachedPage { return new CachedPage( $this->pageCacheDir, $pageUrl, - false === $this->isLoggedIn + false === $this->isLoggedIn, + $validityPeriod ); } }