@@ 1472-1487 (lines=16) @@ | ||
1469 | * @param int|null $seconds if null, the method will return the current s-maxage value |
|
1470 | * @return int|null |
|
1471 | */ |
|
1472 | public function sharedMaxAge($seconds = null) |
|
1473 | { |
|
1474 | deprecationWarning( |
|
1475 | 'Response::sharedMaxAge() is deprecated. ' . |
|
1476 | 'Use withSharedMaxAge() instead.' |
|
1477 | ); |
|
1478 | if ($seconds !== null) { |
|
1479 | $this->_cacheDirectives['s-maxage'] = $seconds; |
|
1480 | $this->_setCacheControl(); |
|
1481 | } |
|
1482 | if (isset($this->_cacheDirectives['s-maxage'])) { |
|
1483 | return $this->_cacheDirectives['s-maxage']; |
|
1484 | } |
|
1485 | ||
1486 | return null; |
|
1487 | } |
|
1488 | ||
1489 | /** |
|
1490 | * Create a new instance with the Cache-Control s-maxage directive. |
|
@@ 1517-1532 (lines=16) @@ | ||
1514 | * @param int|null $seconds if null, the method will return the current max-age value |
|
1515 | * @return int|null |
|
1516 | */ |
|
1517 | public function maxAge($seconds = null) |
|
1518 | { |
|
1519 | deprecationWarning( |
|
1520 | 'Response::maxAge() is deprecated. ' . |
|
1521 | 'Use withMaxAge() instead.' |
|
1522 | ); |
|
1523 | if ($seconds !== null) { |
|
1524 | $this->_cacheDirectives['max-age'] = $seconds; |
|
1525 | $this->_setCacheControl(); |
|
1526 | } |
|
1527 | if (isset($this->_cacheDirectives['max-age'])) { |
|
1528 | return $this->_cacheDirectives['max-age']; |
|
1529 | } |
|
1530 | ||
1531 | return null; |
|
1532 | } |
|
1533 | ||
1534 | /** |
|
1535 | * Create an instance with Cache-Control max-age directive set. |
|
@@ 1564-1581 (lines=18) @@ | ||
1561 | * @return bool |
|
1562 | * @deprecated 3.4.0 Use withMustRevalidate() instead. |
|
1563 | */ |
|
1564 | public function mustRevalidate($enable = null) |
|
1565 | { |
|
1566 | deprecationWarning( |
|
1567 | 'Response::mustRevalidate() is deprecated. ' . |
|
1568 | 'Use withMustRevalidate() instead.' |
|
1569 | ); |
|
1570 | ||
1571 | if ($enable !== null) { |
|
1572 | if ($enable) { |
|
1573 | $this->_cacheDirectives['must-revalidate'] = true; |
|
1574 | } else { |
|
1575 | unset($this->_cacheDirectives['must-revalidate']); |
|
1576 | } |
|
1577 | $this->_setCacheControl(); |
|
1578 | } |
|
1579 | ||
1580 | return array_key_exists('must-revalidate', $this->_cacheDirectives); |
|
1581 | } |
|
1582 | ||
1583 | /** |
|
1584 | * Create an instance with Cache-Control must-revalidate directive set. |