[Typo3-dev] $GLOBALS["TSFE"]->set_no_cache() vs USER_INT

Robert Lemke rl at robertlemke.de
Sun Sep 7 08:56:23 CEST 2003


>> I've had many problems with caching/no caching. almost all plugins I
>> used did clear the cache with $GLOBALS["TSFE"]->set_no_cache() -
>> therefore most of my pages where not indexed at all.
>> to call a function I have the possibility to call it with USER or
>> USER_INT. what is the the $GLOBALS["TSFE"]->set_no_cache() used for?
>> As far as I have seen yet I can skip the
>> GLOBALS["TSFE"]->set_no_cache() if I call my functions with the
>> USER_INT. is this true?

>> can someone explain me, when to use $GLOBALS["TSFE"]->set_no_cache()
>> and when USER_INT?

The USER_INT cObject is not deprecated. Using USER_INT or setting the
no_cache
are just two different things! Make your extension a USER_INT if you don't
want
caching for your output. The difference to setting the no_cache flag is,
that only your
extension's ouput is dynamically created, not the whole page! If you use
$TSFE->set_no_cache(), other content on that page has no chance to be
indexed
or cached.

I think the reason why in some extensions there is a line like
$GLOBALS['TSFE']->set_no_cache() is, that the developer used it for
debugging.

But there's also a situation where it makes sense: If your extension
normally provides
cached output but needs a refresh in certain situations, it might be better
to use a USER
object and clear the cache for the whole page. Because mixing cached and
non-cached
content in one page additionally initialises certain classes which means an
overall overhead.

-- 
robert






More information about the TYPO3-dev mailing list