I am a beginner in TYPO3. I have done an extension with Kickstarter and I want to disable cache only for this extension, and not for the other pages of my TYPO3 website.
How can I do that?
Thanks a lot.
I am a beginner in TYPO3. I have done an extension with Kickstarter and I want to disable cache only for this extension, and not for the other pages of my TYPO3 website.
How can I do that?
Thanks a lot.
Also to disable or limit the caching time on a per page basis might be a solution The setting is under pageicon edit -> tab behaviour -> cache settings (the ?no_cache=1 url parameter)
Another way would be to clear the cache when the data was changed in a sysfolder / set an autoclear in its ts page config for single pages TCEMAIN.clearCacheCmd = 1,3,5 -- numbers are pid comma seperated TCEMAIN.clearCacheCmd = all -- or clear cache all
context links on the archive.org wayback machine - mind all of this is very old - for typo3 v4.5 .. tough i guess some are even now still running ..
http://web.archive.org/web/20180128154846/http://typo3blog.at/blog/artikel/typo3-caching-grundlagen/
you need to pay attention to three locations. First have a look at your ext_localconf.php file. For each plugin (by plugin i mean Frontend Plugin) there is a line similar to this one:
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_yourext_pi1.php', '_pi1', 'list_type', 1);
To disable the cache you need to set the last value to zero, like this.
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_yourext_pi1.php', '_pi1', 'list_type', 0);
Within the Plugin's PHP file (e.g. pi1/class.tx_yourext_pi1.php) you need to ensure that the following line is either deleted, commented out or changed to "false"
$pi_checkCHash = true;
At last, add this line to your main() function (somewhere below the rest):
$this->pi_USER_INT_obj = 1;
That should do it.
cu Roman
Also to disable or limit the caching time on a per page basis might be a solution The setting is under pageicon edit -> tab behaviour -> cache settings (the ?no_cache=1 url parameter)
Another way would be to clear the cache when the data was changed in a sysfolder / set an autoclear in its ts page config for single pages TCEMAIN.clearCacheCmd = 1,3,5 -- numbers are pid comma seperated TCEMAIN.clearCacheCmd = all -- or clear cache all
context links on the archive.org wayback machine - mind all of this is very old - for typo3 v4.5 .. tough i guess some are even now still running ..
http://web.archive.org/web/20180128154846/http://typo3blog.at/blog/artikel/typo3-caching-grundlagen/
Using $GLOBALS['TSFE']->set_no_cache()
will disable caching for the entire page!
Call the function
$GLOBALS["TSFE"]->set_no_cache()
, if you want to disable caching of the page. Call this during development! And call it, if the content you create may not be cached.
Other sources are explanatory.
Instead, make sure that your extension is of type USER_INT
, cf. the docs.
$this->pi_USER_INT_obj = 1;
Unfortunately these answers are more than 8 years old. Nowadays the ExtensionUtility class supplies a switch for disabling caching 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
Use following script for remove cache from current page.
$GLOBALS['TSFE']->set_no_cache()
Above script you can use in your controller file.
© 2022 - 2024 — McMap. All rights reserved.