Feature #28299
closedAdd hook to tslib_fe->getHash()
100%
Description
This hook enables you to modify the hash_base that is used to store
different versions of a page in the cache. Normally it is fixed to
take the id, cHash, groups and some other stuff into account, but does
not allow to add own parameters.
Using this hook you can enable to store different versions of a page
depending on other parameters than GET-parameters.
It also solves an issue that different values of linkVars will produce
the same page if used independent from TypoScript conditions and without
cHash (which otherwise should be forced for all plugins and menu generation).
Files
Updated by Mr. Hudson over 12 years ago
Patch set 1 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Fabrizio Branca over 12 years ago
Also see this post for someone (some time ago...) who needed to do the same:
http://lists.typo3.org/pipermail/typo3-dev/2006-January/014757.html
And also see this thread where someone had the same problem we faced:
http://lists.typo3.org/pipermail/typo3-german/2008-February/043915.html
The problem is that unless you have typoscript conditions set up different values of a linkvar won't result in different versions of a cached page. For languages using the "l" parameter this isn't a problem because the always come along with typoscript conditions, but for individual parameters this might not be posssible.
Besides that you could use this feature to realize some other fancy stuff like having different versions of page depending on if it is in the morning or in the evening. Or you could take session values into account.
Updated by Tolleiv Nietsch over 12 years ago
- Status changed from New to Under Review
Updated by Mr. Hudson over 12 years ago
Patch set 2 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Mr. Hudson over 12 years ago
Patch set 3 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Fabrizio Branca over 12 years ago
- File T3X_gethashhookdemo-0_0_1-z-201107192225.t3x T3X_gethashhookdemo-0_0_1-z-201107192225.t3x added
Providing a simple demo extension that implements the hook. In this case rand(0, 1) is appended to the hash providing to cached versions of a page switched randomly. The extension also provides a static template with a minimum setup displaying a timestamp.
Hit the page. Wait for a couple of seconds and hit the page again. Now refreshing the page should display the both previously generated timestamps randomly.
Updated by Benni Mack over 12 years ago
Hey Fabrizio,
I need a similar modification there as well. But shouldn't we unify "getHash()" and "getLockHash()" and then have one hook there? What do you think?
Updated by Mr. Hudson over 12 years ago
Patch set 4 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Mr. Hudson over 12 years ago
Patch set 5 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Mr. Hudson over 12 years ago
Patch set 6 of change I68b0cfbcbec7eee496c4f903e3a129b7f33ab7c4 has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Gerrit Code Review over 12 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Gerrit Code Review about 12 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/3403
Updated by Thomas Layh about 12 years ago
- File T3X_gethashhookdemo-0_0_1-z-201202101603.t3x T3X_gethashhookdemo-0_0_1-z-201202101603.t3x added
Updated the demoextension for testing with patch set 8
Updated by Fabrizio Branca about 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 432ac6b8d44ef6e2149a7fa29e04f06d9488a99a.