In seldom cases, you will need to start looking into efficiency issues with Chamilo. This guide is a work in progress intended to help administrators optimize their Chamilo installation.
xcache.shm_scheme = "mmap" xcache.size = 32M xcache.count = 2 xcache.slots = 8K xcache.ttl = 0 xcache.gc_interval = 0 xcache.var_size = 16M xcache.var_count = 16 xcache.var_slots = 8K xcache.var_ttl = 60 xcache.var_maxttl = 300 xcache.var_gc_interval = 300 xcache.test = OffxCache will feel useless until you actually start to put some variables in cache. If you're showing the "Who is online" counter, that's one of the best item there is to implement xCache.
$xc = function_exists('xcache_isset'); $number = 0; if ($xc && xcache_isset('campus_chamilo_org_whoisonline_count_simple')) { $number = xcache_get('campus_chamilo_org_whoisonline_count_simple'); } else { $number = who_is_online_count(api_get_setting('time_limit_whosonline')); xcache_set('campus_chamilo_org_whoisonline_count_simple',$number); } $number_online_in_course = 0; if(!empty($_course['id'])) { if ($xc && xcache_isset('campus_chamilo_org_whoisonline_count_simple_'.$_course['id'])) { $number_online_in_course = xcache_get('campus_chamilo_org_whoisonline_count_simple_'.$_course['id']); } else { $number_online_in_course = who_is_online_in_this_course_count(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']); xcache_set('campus_chamilo_org_whoisonline_count_simple_'.$_course['id'],$number_online_in_course); } }Note that, as xCache is a shared caching system, it is very important to prefix your variables with a domain name or some kind of identifier, otherwise it would end up in disaster if you use a shared server for several portals.
php_value zlib.output_compression 1
AddOutputFilterByType DEFLATE text/html text/plain text/xmlor, for every content type (dangerous) you can put the following inside a location or directory block:
SetOutputFilter DEFLATE
# Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 # the above regex won't work. You can use the following # workaround to get the desired effect: BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary