You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/optimization.html
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,38 @@ <h2><a name="1.Using-XCache"></a>1. Using xCache or APC</h2>
245
245
...
246
246
}
247
247
</pre>
248
+
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/>
249
+
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/>
250
+
Locate the main/inc/lib/course_category.lib.php file, open it and go to the browseCoursesInCategory() function.<br/>
251
+
Locate the $count_connections_last_month = Tracking::get_course_connections_count(...) call, and wrap in into something like this:
252
+
<pre>
253
+
$xc = method_exists('Memcached', 'add');
254
+
if ($xc) {
255
+
// Make sure the server is available
256
+
$xm = new Memcached;
257
+
$xm->addServer('localhost', 11211);
258
+
// The following concatenates the name of the database + the id of the
259
+
// access url to make it a unique variable prefix for the variables to
0 commit comments