@ -245,6 +245,38 @@ If you use php5-memcached (different set of functions than php5-memcache!), then
...
}
</pre>
Finally, the Free Campus of Chamilo has a very specific case of slow query: the courses catalog! Because there might be more than 30,000 courses in there, getting the number of "Connections last month" can be a desastrous query in terms of performances. This is why you should try to cache the results as well.<br/>
Obviously, as we are speaking about showing the number of visits this month, it doesn't really matter if the number doesn't refresh for an hour or so...<br/>
Locate the main/inc/lib/course_category.lib.php file, open it and go to the browseCoursesInCategory() function.<br/>
Locate the $count_connections_last_month = Tracking::get_course_connections_count(...) call, and wrap in into something like this:
<pre>
$xc = method_exists('Memcached', 'add');
if ($xc) {
// Make sure the server is available
$xm = new Memcached;
$xm->addServer('localhost', 11211);
// The following concatenates the name of the database + the id of the
// access url to make it a unique variable prefix for the variables to