[ACCEPTED]-TYPO3 - Disable cache for an extension-typo3
you need to pay attention to three locations. First 11 have a look at your ext_localconf.php file. For 10 each plugin (by plugin i mean Frontend Plugin) there 9 is a line similar to this one:
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_yourext_pi1.php', '_pi1', 'list_type', 1);
To disable 8 the cache you need to set the last value 7 to zero, like this.
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_yourext_pi1.php', '_pi1', 'list_type', 0);
Within the Plugin's PHP 6 file (e.g. pi1/class.tx_yourext_pi1.php) you 5 need to ensure that the following line is 4 either deleted, commented out or changed 3 to "false"
$pi_checkCHash = true;
At last, add this line to your 2 main() function (somewhere below the rest):
$this->pi_USER_INT_obj = 1;
That 1 should do it.
cu Roman
Also to disable or limit the caching time 9 on a per page basis might be a solution The 8 setting is under pageicon edit -> tab 7 behaviour -> cache settings (the ?no_cache=1 6 url parameter)
Another way would be to clear 5 the cache when the data was changed in a 4 sysfolder / set an autoclear in its ts page 3 config for single pages TCEMAIN.clearCacheCmd 2 = 1,3,5 -- numbers are pid comma seperated TCEMAIN.clearCacheCmd 1 = all -- or clear cache all
http://typo3blog.at/blog/artikel/typo3-caching-grundlagen/
http://typo3weblog.de/2008/07/26/tcemainclearcachecmd-statt-clear-cache-button/
Using $GLOBALS['TSFE']->set_no_cache()
will disable caching for the entire page!
Call the function
$GLOBALS["TSFE"]->set_no_cache()
, if you 5 want to disable caching of the page. Call 4 this during development! And call it, if 3 the content you create may not be cached.
Other sources are 2 explanatory.
Instead, make sure that your 1 extension is of type USER_INT
, cf. the docs.
$this->pi_USER_INT_obj = 1;
Unfortunately these answers are more than 3 8 years old. Nowadays the ExtensionUtility 2 class supplies a switch for disabling caching 1 based on actions:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MyCompany.' . $_EXTKEY,
'Sample',
['Sample' => 'index'],
// non-cacheable actions:
['Sample' => 'index']
);
https://docs.typo3.org/typo3cms/ExtbaseFluidBook/4-FirstExtension/7-configuring-the-plugin.html
Let's update this question with more recent 7 info that applies to TYPO3 CMS 6.0.x-6.2.x 6 at the time of this writing. If you have 5 a dev site that's not live yet, I'd used 4 the uncache extension made by the FluidTYPO3 team. It's 3 nice to be able to just disable cache entirely 2 until you get the bugs worked out so you're 1 not clearing cache every 2 seconds.
- uncache at TER (TYPO3 Extension Repository)
- uncache at GitHub
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.