Bug #41033
closedCheck cHash in TSFE only if necessary
100%
Description
Sometimes a cHash URl parameter is passed to the Frontend but there are no other variables to use for cHash calculation. This may happen, for example, if TS incorrectly uses typoLink with useCacheHash=1 but without additionalParams or if additionalParams are set from the current query string.
The result is extra cache entries, unneeded flooding of core and RealURL caches, useless checks.
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14688
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14688
Updated by Gerrit Code Review about 11 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/14688
Updated by Gerrit Code Review about 11 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/14688
Updated by Ingo Schmitt about 10 years ago
- Category set to Performance
- Is Regression set to No
Updated by Wouter Wolters about 9 years ago
- Status changed from Under Review to New
Updated by Benni Mack almost 5 years ago
- Status changed from New to Needs Feedback
Hey Dmitry,
VERY BIG SORRY that this issue has been unanswered for such a long time.
Fortunately we've structured the cHash calculation much more in v9. Question is: Can I somehow reproduce this in v9? Could you provide a TypoScript setup?
Also, what's the setting of $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError'] in this installation?
Updated by Dmitry Dulepov almost 5 years ago
Hi Benni. This ticket is 7 years old. The installation is upgraded to another version, so I cannot check this anymore. But you can simulate the issue easily by creating a cHash from just an id parameter. I think current TYPO3 have safeguards from it, so it will not let you, so you need to comment some checks in CacheHashCalculator. I believe such bad links cannot be created by TYPO3 anymore. However links with cHash still come from search engines or user's bookmarks, so the case is still valid. It still makes 404s due to unneeded cHash.
Updated by Benni Mack almost 5 years ago
Hey Dmitry,
ah, I see your point. I think the issue was mitigated when we introduced the "include page ID in cHash calculation" part. However, I know what you mean:
Check 1. if a cHash is present it MUST match, otherwise 404/disable Cache
Check 2. otherwise check if there are relevant parameters that would need a cHash
This is how it's in v9.
I guess we'd need to do a
if ($cHash && !$hasRelevantParameters) {
// skip cHash validation and remove cHash from GET vars
} elseif (cHash and hash_comparision) {
Check 1
} elseif (nocHash && $hasRelevantParameters) {
Check 2
}
question would be if we'd disable caching then or fallback to "pretent there was no cHash"
Updated by Dmitry Dulepov almost 5 years ago
I think the issue was mitigated when we introduced the "include page ID in cHash calculation" part
No, it was not. cHash can still be supplied. But if the code works like you described (=checking relevant parameters), then it should be fine in v9. Not in older versions though. The patch for them was submitted by me long time ago...
Updated by Gerrit Code Review almost 5 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60895
Updated by Gerrit Code Review almost 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60895
Updated by Gerrit Code Review almost 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60895
Updated by Gerrit Code Review almost 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60895
Updated by Benni Mack almost 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f070cd9b851498dc767875e5a9a47f80e59de397.
Updated by Benni Mack almost 5 years ago
- Related to Task #88531: Create redirect instead of silently ignoring obsolete cHash added
Updated by Gerrit Code Review almost 5 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60952
Updated by Benni Mack almost 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset 0567ec3b1e9f3b32dfa0f96f9b5103f2bed529cb.