Posted on: 12/16/08 10:34am
By: 1000ideen
Re: every 2 minutes cache of frontpage
Posted on: 01/20/09 05:29am
By: 1000ideen
I think this was a pretty cool idea. Wouldn`t that be a good solution for high traffic Geeklogs?
Re: every 2 minutes cache of frontpage
Posted on: 01/20/09 08:27pm
By: jmucchiello
What happens to the "Welcome to Geeklog, Fred" if you cache the home page?
Re: every 2 minutes cache of frontpage
Posted on: 01/21/09 03:11am
By: 1000ideen
The index.htm is only being presented to those who have no cookie of that site. All the others who login or have a language or theme cookie will be presented the index.php / normal Geeklog.
So this cacheing of the front page takes away some load and it is a concept the people of phpbb have some experience with.
Re: every 2 minutes cache of frontpage
Posted on: 01/21/09 11:35pm
By: jmucchiello
Then how much improvement you would see depends on how much of your traffic logs in or doesn't. A community site would probably see less benefit from a news for the world site.
Re: every 2 minutes cache of frontpage
Posted on: 01/22/09 08:29am
By: 1000ideen
The phpbb.de people say that about 30 users without a cookie are permanently on the homepage.
http://www.phpbb.de/kb/cache_index[*2] This is probably because google leads them to the homepage as they are looking for "phpbb". There is a crontab running every 2 minutes to cache the homepage.
I tried that manually with GL and made an index.htm homepage. Most registered users didn`t notice the difference. They log in or have a cookie already and go to the forum anyway. This was not a perfect test but I wanted to see any potential problems.
Anyway I don`t really have a high traffic site and one needs to measure the difference.
Re: every 2 minutes cache of frontpage
Posted on: 01/25/09 10:47am
By: Anonymous (ismael)
I need something kind of cache. My site has a lot of traffic and i have problems with 500 users online. Too many data base connections.
i've read this but i don't know if it will be good for geeklog:
.htaccess:
php_value auto_prepend_file /home/user/public_html/start_cache.php
php_value auto_append_file /home/user/public_html/end_cache.php
start_cache.php:
<?
$settings_cachedir = '/home/user/public_html/cache_files/';
$settings_cachetime = 3600; //keep cache files for 3600 seconds (1 hour)
//Pagina php
$thispage = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$cachelink = $settings_cachedir.md5($thispage).".html";
if (@file_exists($cachelink)) {
$cachelink_time = @filemtime($cachelink);
if ((time() - $settings_cachetime) < $cachelink_time) { @readfile($cachelink);die(); }
}
ob_start();
?>
end_cache.php:
<?
$fp = fopen($cachelink, 'w'
;@fwrite($fp, ob_get_contents());@fclose($fp);ob_end_flush();
?>
Re: every 2 minutes cache of frontpage
Posted on: 01/25/09 11:17am
By: jmucchiello
Quote by: ismael@readfile($cachelink);die(); }
I would change that to
Text Formatted Code
{
@readfile($cachelink) AND die();
}
This way, if for some reason the cache file isn't found, the code attempts to generate and recache the file instead of dying with no output.
The other issue with this code is if your site generates any kind of headers, the cache won't save them.
Re: every 2 minutes cache of frontpage
Posted on: 01/26/09 05:20am
By: 1000ideen
@ismael it would be great if you could give some feedback later on with your experience and some data on how the situation improved
How many of those 500 users are registered and have a cookie? Are there many guests who go tho the front page
: