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

Bart van Doveren webmaster at _remove_afsvlaanderen.be
Mon Sep 8 11:09:27 CEST 2003


"Robert Lemke" <rl at robertlemke.de> wrote in message
news:mailman.1062917788.30266.typo3-dev at lists.netfielders.de...
> >> 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.

Thank you for this clarification, Robert.
A question: how do I set an extension that provides a new content-element
that should be dynamically created without having to set the whole page to
no_cache?






More information about the TYPO3-dev mailing list