Review main Merged

86007[FEATURE] Introduce config.sendCacheHeadersForSharedCaches

Benni Mack CR +2 V +2 Normal +160 −26 updated 09/15/24, 06:12

Commit message

Instead of config.sendCacheHeaders which
might have your users see the same content for a long
time, it is recommended to use
config.sendCacheHeadersForSharedCaches = auto
instead, because this now sends the following HTTP Header:

Cache-Control: max-age=0, s-maxage=12345

where as s-maxage is the number of seconds how long
the proxy / CDN is allowed to cache, while the browser/client
should never cache this.

This way, the proxy can decide on how long to cache things.

See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Benjamin Franzke +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Benjamin Franzke +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1318

  1. Benni Mack uploaded patch set 1 09/11/24, 09:12

  2. core-ci voted on patch set 1 V +1 09/11/24, 09:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65395

  3. Benni Mack uploaded patch set 2 V +1 09/11/24, 17:40

  4. Benni Mack uploaded patch set 3 09/11/24, 17:43

  5. core-ci voted on patch set 2 V -1 09/11/24, 17:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65474

  6. core-ci voted on patch set 3 V +1 09/11/24, 17:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65477

  7. Oliver Hader commented on patch set 3 09/12/24, 10:12

    Is there a "simple" way to test the new behavior with a "common CDN configuration"?
  8. Benni Mack commented on patch set 3 09/12/24, 10:15

    Reply

    If you are familiar with TYPO3 config settings `reverseProxyIP` and make sure it applies like this (thus, REMOTE_ADDR matches a different result when set to reverseProxyIP) then you should receive different HTTP Response Headers.
  9. Benjamin Franzke uploaded patch set 4 V +1 09/14/24, 07:49

    Resolve Merge Conflict
  10. core-ci voted on patch set 4 V +1 09/14/24, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65744

  11. Benjamin Franzke commented on patch set 4 CR -1 09/14/24, 08:04

    TypoScriptFrontendController.php:812

    While it's good to check this in a reverse-proxy setup, there may be shared caches that do not use a reverse-proxy setup: nginx cache be configured to store php results in a cache (fastcgi cache). In this case the webserver itself is the shared cache and there is not trusted reverse proxy ip configured/available. I'd love some additional option to force these headers. I'm thinking about: ``` # only send if behind reverse proxy config.sendCacheHeadersForSharedCaches = auto # always send config.sendCacheHeadersForSharedCaches = 1 ```

    TypoScriptFrontendController.php:818

    I'd love to send `private, no-store` to the client, but I'm not sure how (commercial) caching proxies react to that. I guess there will be some, that'd ignore the cache alltogether in that case. At least `must-revalidate` would be nice, but then again, the proxy could think it's has to revalidate (although they should only use `proxy-revalidate`).
  12. Benjamin Franzke uploaded patch set 5 CR -1 V +1 09/14/24, 08:21

  13. Benjamin Franzke commented on patch set 5 09/14/24, 08:21

    TypoScriptFrontendController.php:812 Reply

    Done

    TypoScriptFrontendController.php:818 Reply

    post poned.
  14. core-ci voted on patch set 5 V +1 09/14/24, 08:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65745

  15. Stefan Bürk voted on patch set 5 CR +1 09/14/24, 22:40

  16. Stefan Bürk voted on patch set 5 V +1 09/14/24, 23:39

  17. Benni Mack commented on patch set 5 CR +2 V +2 09/15/24, 06:12

    thank you both
  18. Benni Mack merged patch set 6 09/15/24, 06:12