Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/public/AppFramework/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ public function __construct() {
* @return $this
* @since 6.0.0 - return value was added in 7.0.0
*/
public function cacheFor(int $cacheSeconds) {
public function cacheFor(int $cacheSeconds, bool $public = false) {
if ($cacheSeconds > 0) {
$this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds . ', must-revalidate');

// Old scool prama caching
$this->addHeader('Pragma', 'public');
$pragma = $public ? 'public' : 'private';
$this->addHeader('Cache-Control', $pragma . ', max-age=' . $cacheSeconds . ', must-revalidate');
$this->addHeader('Pragma', $pragma);

// Set expires header
$expires = new \DateTime();
Expand Down