[FEATURE] Introduce CacheHashConfiguration and matching indicators
Settings for $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash'] are modelled in CacheHashConfiguration which takes care of validating configuration. It also determines whether corresponding aspects apply to a given URL parameter. Besides exact matches (equals) it is possible to apply partial matches at the beginning of a parameter (startsWith) or inline occurrences (contains). URL parameter names are prefixed with the following indicators: + = (equals): exact match, default behavior if not given + ^ (startsWith): matching the beginning of a parameter name + ~ (contains): matching any inline occurrence in a parameter name These indicators can be used for all previously existing sub-properties 'cachedParametersWhiteList', 'excludedParameters', 'excludedParametersIfEmpty' and 'requireCacheHashPresenceParameters'. Example: $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash'] = [ 'excludedParameters' => [ 'utm_source', 'utm_medium', '^utm_', // making previous two obsolete ], 'excludedParametersIfEmpty' => [ '^tx_my_plugin[aspects]', 'tx_my_plugin[filter]', ], ]; Resolves: #90234 Releases: master Change-Id: I16d316e463b7c94c5eb75069f8c24ffde135d080 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63062 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Susanne Moog <look@susi.dev> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Susanne Moog <look@susi.dev>
Showing
- typo3/sysext/core/Documentation/Changelog/master/Feature-90234-IntroduceCacheHashConfigurationAndMatchingIndicators.rst 78 additions, 0 deletions...-IntroduceCacheHashConfigurationAndMatchingIndicators.rst
- typo3/sysext/frontend/Classes/Page/CacheHashCalculator.php 36 additions, 85 deletionstypo3/sysext/frontend/Classes/Page/CacheHashCalculator.php
- typo3/sysext/frontend/Classes/Page/CacheHashConfiguration.php 205 additions, 0 deletions...3/sysext/frontend/Classes/Page/CacheHashConfiguration.php
- typo3/sysext/frontend/Tests/Unit/Page/CacheHashCalculatorTest.php 12 additions, 7 deletions...sext/frontend/Tests/Unit/Page/CacheHashCalculatorTest.php
- typo3/sysext/frontend/Tests/Unit/Page/CacheHashConfigurationTest.php 235 additions, 0 deletions...t/frontend/Tests/Unit/Page/CacheHashConfigurationTest.php
Please register or sign in to comment