2
votes

I'm trying to deactivate cHash in my extension ... the link for the show action looks like this:

/?tx_abc_abc[record]=1&tx_abc_abc[action]=show&tx_abc_abc[controller]=Abc&cHash=10c78febea3ae5dsdf535fb36ca6d08

In ext_localconf.php I tried to deactivate cHash like this:

ext_localconf.php

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Vendor.' . $_EXTKEY,
    'Abc',
    array(
        'Abc' => 'list,show',

    ),
    // non-cacheable actions
    array(
        'Abc' => 'list,show',

    )
);

$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_abc_abc[record],tx_abc_abc[action],tx_abc_abc[controller]';

It's not working though. What am I missing?

2

2 Answers

5
votes

You need to deactivate the cHash when building the links in your template. If you are using the ViewHelper <f:link.action>, then you need to set the attribute noCacheHash="1".

4
votes

For TYPO3 9 and 10

All we need to do is configure the parameter from which you don't want your chash to be calculated

For example, your link is like this

<f:link.action action="detail" 
        additionalParams="{
            tx_plugin_action:{
               param1:1, param2:2, param3: 3
            },
            param4: 4
        }">Link Text</f:link.action>

Then you have to exclude all the parameters in Localconfiguration.php

'FE' => [
    'cacheHash' => [
        'excludedParameters' => [
            'tx_plugin_action[param1]',
            'tx_plugin_action[param2]',
            'tx_plugin_action[param3]',
            'param4',
        ],
    ],
]

Additionally: Remember that if any of the parameter is not included here then it will calculate and generate chash

Note: Here We don't need to set noCacheHash="1" explicitely in viewhelper