Review main Abandoned

77921[FEATURE] Add method to change page cache expiration

Christoph Lehmann CR 0 V 0 Easy +39 −7 updated 03/14/23, 17:46

Commit message

The new public method TypoScriptFrontendController::setMinimalCacheExpires()
can be used to reduced the page cache expiration.

In addition Extbase plugins can return a response with a cache control header
in order to reduce the page cache expiration. Example:

public function showAction(): ResponseInterface
{
    return $response->withHeader('Cache-Control', 'max-age=3600');
}

This would reduce the expiration time to 3600 seconds.

Review

  • Code review CR 0
  • Verified V 0

Files 2

Review log 45

  1. Christoph Lehmann uploaded patch set 1 02/21/23, 21:28

  2. Christoph Lehmann marked it work in progress 02/21/23, 21:29

  3. core-ci voted on patch set 1 V +1 02/21/23, 21:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37944

  4. Sybille Peters commented on patch set 1 02/22/23, 03:45

    Compared with the other solution which now uses the event https://review.typo3.org/c/Packages/TYPO3.CMS/+/77894 - from the client end it is more convenient because there is less to implement (no Event Listener etc. - from the code structure I am less sure. The event now also makes it possible to set the cache tags which means you would no longer have to call the public function for that in the future, you can do it all in one place and it has a clear interface. Apart from that I don't have a stake in either - would be ok if we go that way. Should add a changelog .rst file though, ideally with code example for client. You can use the ReST helper (which helps to create a file name from the title etc.): https://forger.typo3.com/utilities/rst
  5. Christoph Lehmann abandoned the change 03/14/23, 17:46