[BUGFIX] Support concurrent requests without 503 responses
Instead of offloading the work to wait for the final page content, concurrent requests now wait for the real page content to be rendered (and deliver the content from cache once ready) instead of sending a 503 response code and the famous "Page is being generated" message. The logic to wait for the rendered page (lock and wait) is already there thanks to the page locking, but was deliberately circumvented by the temporary page cache content before to get rid of waiting requests in high-load situations. This approach to simply skip the temporary cache and wait for the renderer to finish has been tested using the skip_page_is_being_generated extension in wild for 3 years (for TYPO3 v6, v7, v8 and v9). Note: In case the increased number of waiting requests has a negative impact on sites with high server load, a additional proxy cache should be considered in front of the server to make sure clients are served a valid response without waiting until new content is ready. The motivation for this change: The 503 status code together with the "Page is being generated message" does not only occur for slow or high traffic sites. It will be displayed even for two concurrent requests, no matter how fast the page rendered or how low the current traffic is. The requests only need to (nearly) arrive at the same time. This can easily be reproduced using two parallel curl requests: for i in {1..2}; do curl -sv https://doma.in/foo |& grep '^< HTTP'& done There would be one "503 Service unavailable" response when /foo has not yet been rendered to the cache before. An explanation for the releaseLock('pagesection') addition in TSFE::getFromCache(): This has been added as the pagesection lock – which is acquired in TemplateService::start() – was implicitly released in setPageCacheContent() before. Now this would block concurrent rendering for pages with $_GET-aware plugins, therefore we release the pagesection lock early, after the pagesection cache has been generated. Releases: master, 9.5, 8.7 Resolves: #87980 Change-Id: I034f410335b3035c5863b26e3e689ca29b5f3f80 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60307 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Oliver Hader <oliver.hader@typo3.org> Tested-by:
Helmut Hummel <typo3@helhum.io> Tested-by:
Benjamin Franzke <bfr@qbus.de> Reviewed-by:
Georg Ringer <georg.ringer@gmail.com> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Reviewed-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benjamin Franzke <bfr@qbus.de>
Showing
- typo3/sysext/core/Documentation/Changelog/master/Important-87980-PageIsBeingGeneratedMessageHasBeenRemoved.rst 34 additions, 0 deletions...rtant-87980-PageIsBeingGeneratedMessageHasBeenRemoved.rst
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 35 additions, 121 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
- typo3/sysext/t3editor/Resources/Private/tsref.xml 0 additions, 8 deletionstypo3/sysext/t3editor/Resources/Private/tsref.xml
- typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js 0 additions, 1 deletion...Resources/Public/JavaScript/Mode/typoscript/typoscript.js
Please register or sign in to comment