[Typo3] performance, cache-control headers and published static pages

Mathias Schreiber [wmdb>] mathias.schreiber at wmdb.de
Wed Jun 22 08:48:41 CEST 2005


Michael Häusler wrote:
> Hi there,
> 
> I have just tried out the new feature of cache-control headers and I am 
> delighted. The difference in performance for recurring users is amazing.
> 
> Unfortunately, it can't do very much for most first-time visitors.
> Unfortunately, I have to run a Typo3 installation on a slow server. The 
> best solution would probably be a proxy at the server, which caches the 
> pages. Unfortunately, I can't do that.
> 
> So, I am searching for different ways to increase the performance of the 
> frontend. Most pages are pretty static and change only once a month - 
> some pages change daily. So it is feasible to publish those pages to 
> static html files. (btw, is it possible to publish without having to use 
> the admin panel?)
> 
> Wouldn't it be wonderful, if those two methods (cache control & 
> publishing) could be combined?
> Everytime Typo3 recognizes that a requested page could be cached, it 
> publishes this page as a static html file. It could prepend this file 
> with a small php header, which checks if the current server time is 
> beyond the expiration limit of this page. If so, this would trigger 
> republishing of the page.

I got another idea:
If you use simulateStatic mod_rewrite works like this:
Page huselpusel.103.0.html is requested.
Apache does not find the static file in the filesystem thus starting 
mod_rewrite and requesting the page from typo3.
So you could do the following:
When the page content is echoed by index_ts.php you check whether you 
checked the checkbox "write to static" or stuff is checked and then 
write everything in $content into a file.
You can then use a hook in TCEForms that checks if something on that 
page has been checked, crosscheck what other pages are affected by that 
change (tricky) and simply delete (!) all the static html files that 
have been written so far.
On the next request to one of that pages, the file is written, because 
mod_rewrite triggers index_ts.php.

I thought about writing a concept for that but when I was nearly 
finished realURL came up and my whole idea was spoiled :)

-- 
if ($GLOBALS['TSFE']->fe_user->user['ahnung'] == 0) {
	$this->fresseHalten = 1;
}



More information about the TYPO3-english mailing list