Project

General

Profile

Actions

Bug #41033

closed

Check cHash in TSFE only if necessary

Added by Dmitry Dulepov over 11 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2012-09-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #88531: Create redirect instead of silently ignoring obsolete cHashClosedBenni Mack2019-06-08

Actions
Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

Updated by Ingo Schmitt about 10 years ago

  • Category set to Performance
  • Is Regression set to No
Actions #6

Updated by Wouter Wolters about 9 years ago

  • Status changed from Under Review to New
Actions #7

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?

Actions #8

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.

Actions #9

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"

Actions #10

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...

Actions #11

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

Actions #12

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

Actions #13

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

Actions #14

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

Actions #15

Updated by Benni Mack almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Benni Mack almost 5 years ago

  • Related to Task #88531: Create redirect instead of silently ignoring obsolete cHash added
Actions #17

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

Actions #18

Updated by Benni Mack almost 5 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF