Openfire Cache (roster)

Hi, I have finished importing buddy lists on the database and linked it to the site (it’s about 220k rows)

the problem I see is that if I add a friend on the site the roster on the client will not be updated because the cache

seems to last a bit too long.

I was searching for the correct key to nullify the cache for the jiveRoster table but couldn’t find anything.

do you have any idea?

version is 3.5.2 at the moment

regards.

You can clear the caches manually on the Admin Console > Server > Server Manager > Cache Summary page. Also there is some Openfire system properties related to that. You can find them in that list http://www.igniterealtime.org/community/docs/DOC-1061

thanks for your reply.

unluckily I don’t see any way to nullify the roster cache, I’m writing a little spider that will submit the proper form every 2/3 minutes from the Admin Console.

as it works now it’s almost useless to have the possibility to add friends from another system (ie: a site) because it will take too long to see the new friend online.

here’s a piece of php code, should anyone need it

function destroy_cache($password, $username, $domain, $cookie){

/*
$password = “your pass”;
$username = “your admin user”;
$domain = “http://your_domain:9090/”;
$cookie = “./cookie_openfire.txt”; //must exist here.

*/

$POST = “url=%2Findex.jsp&login=true&username=”.$username."&password=".$password;
$page_ = $domain.“login.jsp”;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page_);
curl_setopt($ch, CURLOPT_POSTFIELDS, $POST);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
$data = curl_exec($ch);
curl_close($ch);

    for($i = -1; $i<=32; $i++){
        $cacheID[] = $i;
    }

$POST = join("&cacheID=", $cacheID);
$POST = $POST."&clear=Clear+Selected";
$page_ = $domain.“system-cache.jsp”;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page_);
curl_setopt($ch, CURLOPT_POSTFIELDS, $POST);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
$data = curl_exec($ch);
curl_close($ch);

}

destroy_cache($password, $username, $domain, $cookie);

I think you could disable the roster cache by setting the following two system properties.

cache.username2roster.maxLifetime 0

cache.username2roster.size 0

Hello Shawn,
Would you give me some pointers on where to go to edit those properties?

Thank you.