[TYPO3-dev] set_no_cache is bad. What's next?

R. van Twisk typo3 at rvt.dds.nl
Fri Mar 30 02:53:24 CEST 2007


..... <snip>
> E.g. tt_board is usually a USER object. So everything is cached by default.
>
> But if someone has submitted new text, then this should be shown
> immediately to all the others who will in the near future visit this
> page or a list page above.
>
> This is done by this command:
>
> $this->clear_cacheCmd(intval($this->newData['tt_board']['NEW']['pid']));
>
> or
> $this->clear_cacheCmd($pid);
>
> /**
>  * Form-data processing class.
> **/
>
> tslib_feTCE::
>
> /**
> 	* Clear cache for page id.
> 	* If the page id is the current page, then set_no_cache() is called (so
> page caching is disabled)
> 	*
> 	* @param	integer		The page id for which to clear the cache
> 	* @return	void
> 	* @see tslib_fe::set_no_cache()
> 	*/
> function clear_cacheCmd($cacheCmd)	{
> 	$cacheCmd = intval($cacheCmd);
> 	if ($cacheCmd)	{
> 		$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages',
> 'page_id='.intval($cacheCmd));
> 		if ($cacheCmd == intval($GLOBALS['TSFE']->id))	{	// Setting no_cache
> true if the cleared-cache page is the current page!
> 			$GLOBALS['TSFE']->set_no_cache();
> 		}
> 	}
> }
>
>
> So the set_no_cache is still needed.
> Normally all the tt_board pages are cached and this should be like this.
> Only sometimes when somebody enters a new post, then the pages showing
> it must be cleared from cache. It would be no good solution if it would
> be necessary to turn the caching totally off for the tt_board extension.
> I cannot see any improvement in deleting the set_no_cache function. It
> should remain but be enhanced to only delete the parts of the cache
> belonging to an extension. The entered texts will normally remain the
> same until someone, may only once in a month, wants to change them.
>
>
> - Franz
>
>
>
>   

Hey Franz,

nice explanation, and I go a bit OT and I will go to the extreme.
The above method also means that if you have 50.000 posts,
you will loose the complete cache for all posts, just because
somebody else added a single other post.....

I think I am right.... am I???

It just means that if a typo3 installation is mostly community driven.
Which means only a couple of pages but lots of forums and dynamic
content from single plugins etc etc.
Then the cache is almost useless if you have frequent additions to the 
board.
And then all of a sudden google  and yahoo wants to index
all content (means the 50.000 different views of the board) then the server
will be highly loaded.....


Ries










More information about the TYPO3-dev mailing list