[TYPO3-english] Caching multiple versions of the same page with a unique URL

Fabrice Morin fmo at sword.eu
Thu Jul 21 15:20:40 CEST 2016


Hello,

What is the best way to cache multiple versions of a page (using the cHash mechanism) when this page have a unique URL but can be dynamically changed using information in the request header ?

The use-case is using Akamai content-targeting. Akamai sends the country_code in the request header, we can retrieve it from PHP, compute the page content according to this country code and render the page. The problem is to cache the result, since the URL is unique to all countries, the cHash will be identical for all visitors from different countries, and the first visitor will cache the page for everyone.

Is there a way to alter the cHash computation ? According to what I see from TypoScriptFrontendController::makeCacheHash() function, only the query string is relevant, and there is no hook.

The only way I can currently think of is to use the function TypoScriptFrontendController::checkAlternativeIdMethods() to add the country code to the URL and hide it using realurl, this way the cHash will take in account this new parameter, but I'm not sure if it will work (there will be a unique mapped URL with multiple technical URLs with different cHash values).

Any other ideas ?

Thanks,
Fabrice


More information about the TYPO3-english mailing list