Project

General

Profile

Actions

Feature #39178

closed

Configuration for always enabling cHashes

Added by Francois Suter almost 12 years ago. Updated almost 12 years ago.

Status:
Rejected
Priority:
Could have
Category:
Frontend
Target version:
Start date:
2012-07-23
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
easy
Sprint Focus:

Description

It it possible to force typolinks to use cHashes with property "useCacheHash". It would be convenient to be able to do this across the Core. I propose introducing property:

config.typolinkUseCacheHash

which - if set - would override individual "useCacheHash" definitions.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Feature #28299: Add hook to tslib_fe->getHash()ClosedFabrizio Branca2011-07-18

Actions
Actions #1

Updated by Francois Suter almost 12 years ago

My use case is about having additional variables passed in all links (using config.linkVars) that should be taken into account for calculating the cache too. In a specific case, it was a site where we use both language and country to define the content, thus the cache hash needs to take the country into account. For this it is necessary to have cHashes (or hack the Core elsewhere to force it to take the country into account, but using cHashes seems the cleanest way).

Actions #2

Updated by Helmut Hummel almost 12 years ago

  • Status changed from Accepted to Needs Feedback

Francois Suter wrote:

My use case is about having additional variables passed in all links (using config.linkVars) that should be taken into account for calculating the cache too. In a specific case, it was a site where we use both language and country to define the content, thus the cache hash needs to take the country into account. For this it is necessary to have cHashes (or hack the Core elsewhere to force it to take the country into account, but using cHashes seems the cleanest way).

Don't you have conditions for the respective parameters in linkVars anyway? If so, a cHash would be obsolete.

Actions #3

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12994

Actions #4

Updated by Francois Suter almost 12 years ago

You're right that conditions could fit the bill. However in my use case the parameter that we needed to take into account was a country number and the site was available for 186 countries. I can't imagine the cost of using so many TS conditions.

Furthermore I think that this change fits well with the new cHash calculations that were introduced in TYPO3 4.7.

Actions #5

Updated by Ernesto Baschny almost 12 years ago

I think it might be "dangerous" to have such a setting which requires lots of knowledge about the caching and hash mechanisms of TYPO3. Once set, it will also add cHash to stuff where we explicitly don't want a cHash (search forms, ...).

Maybe it would be cooler to add a hook to TSFE->getHash() allowing the hook to add parameters to the hash_base which is used to generate the md5 of the cache entry, so that you could add your "country" parameter to the list.

Actions #6

Updated by Francois Suter almost 12 years ago

Yes, that could be another possibility. I'm not sure it would help with forms, though, as I'm unsure you could really detect for what usage you are currently generating the link. But you're right it's still probably safer this way.

Actions #7

Updated by Francois Suter almost 12 years ago

Ah, ah, interesting, someone already had the same issue (I'm not surprised ;-) ). There's already such a hook in the Core since 4.7, somehow I missed it while investigating cHash creation. I'm going to close this issue as a duplicate.

Actions #8

Updated by Francois Suter almost 12 years ago

  • Status changed from Under Review to Rejected
Actions

Also available in: Atom PDF