Feature #39178
closedConfiguration for always enabling cHashes
0%
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.
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).
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.
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
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.
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.
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.
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.
Updated by Francois Suter almost 12 years ago
- Status changed from Under Review to Rejected