Project

General

Profile

Actions

Feature #28299

closed

Add hook to tslib_fe->getHash()

Added by Fabrizio Branca over 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2011-07-18
Due date:
% Done:

100%

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

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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #29365: better cHash calculation (avoid cache flooding of USER_INT)Closed2011-08-30

Actions
Is duplicate of TYPO3 Core - Feature #39178: Configuration for always enabling cHashesRejectedFrancois Suter2012-07-23

Actions
Actions #1

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

Actions #2

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.

Actions #3

Updated by Tolleiv Nietsch over 12 years ago

  • Status changed from New to Under Review
Actions #4

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

Actions #5

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

Actions #6

Updated by Fabrizio Branca over 12 years ago

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.

Actions #7

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?

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

Updated by Thomas Layh about 12 years ago

Updated the demoextension for testing with patch set 8

Actions #14

Updated by Fabrizio Branca about 12 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF