/** * Attempts to cache the sent entity by its last modification date. * @param string|int|DateTime last modified time * @param string strong entity tag validator * @param mixed optional expiration time * @return void * @throws Nette\Application\AbortException */ public function lastModified($lastModified, $etag = NULL, $expire = NULL) { if ($expire !== NULL) { $this->httpResponse->setExpiration($expire); } if (!$this->httpContext->isModified($lastModified, $etag)) { $this->terminate(); } }
/** * Attempts to cache the sent entity by its last modification date. * @param string|int|\DateTimeInterface last modified time * @param string strong entity tag validator * @param mixed optional expiration time * @return void * @throws Nette\Application\AbortException */ public function lastModified($lastModified, $etag = NULL, $expire = NULL) { if ($expire !== NULL) { $this->httpResponse->setExpiration($expire); } $helper = new Http\Context($this->httpRequest, $this->httpResponse); if (!$helper->isModified($lastModified, $etag)) { $this->terminate(); } }