mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-24 12:45:05 +02:00
[core] Returning 304 http code when returning cached data (#793)
This commit is contained in:
parent
059656c370
commit
422c125d8e
3 changed files with 33 additions and 0 deletions
|
@ -7,6 +7,7 @@ abstract class FormatAbstract implements FormatInterface {
|
|||
$contentType,
|
||||
$charset,
|
||||
$items,
|
||||
$lastModified,
|
||||
$extraInfos;
|
||||
|
||||
public function setCharset($charset){
|
||||
|
@ -27,11 +28,18 @@ abstract class FormatAbstract implements FormatInterface {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setLastModified($lastModified){
|
||||
$this->lastModified = $lastModified;
|
||||
}
|
||||
|
||||
protected function callContentType(){
|
||||
header('Content-Type: ' . $this->contentType);
|
||||
}
|
||||
|
||||
public function display(){
|
||||
if ($this->lastModified) {
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s ', $this->lastModified) . 'GMT');
|
||||
}
|
||||
echo $this->stringify();
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue