LCache Speed Up

Add-ons LCache Speed Up 1.0.4

Register & Get access to index
Compatible XF Versions
1.3 , 1.4 , 1.5
Visible Branding
No
LCache is a caching solution that creates multiple layers to store data. It allows for reads to be stored within APCu or SQLite for speed while it stores the data in a second layer on your database. This makes caching for users simple as most already have these two setup! It also makes it possible for a master-master caching solution that is inexpensive and very fast.

On my website I dropped from 0.6s to 0.06s! My setup is a geo-replicated WAN cluster so people with similar configurations will see great performance increase! Your experience may vary :)

All you need to set this up is PHP 5.6 or greater and APCu.
Install the add-on and go into your config.php and put these lines somewhere after the database options:
PHP:
if (php_sapi_name() !== 'cli') {
    $config['cache']['backend'] = 'LCache';
    $config['cache']['backendOptions'] = array(
        'l2' => array(
            'type' => 'mysql',
            'prefix' => 'xf_',
            'config' => $config['db']
        )
    );
}

Once this is in your config.php you are done!
Available options for the configuration are as follows:

PHP:
// Define a bin where it will be stored. Allows for multiple sites to use the caching service on the same DB.
'bin' => 's1',
// The PHP pool. Define a custom one, use null for the pool IP/ID, or use [B]hostname[/B] to use your server's hostname.
'pool' => null,
// Used internally. Does not apply to XF.
'group' => 'default',
// Whether or not an item has an expiration date.
 'can_expire' => true,
// L1 Configuration
 'l1' => array(
  'type' => 'apcu',
  'config' => array()
),
// L2 Configuration
'l2' => array(
  'type' => 'mysql',
  'prefix' => 'xg_',
  'config' => array()
)

Initial page loads may be longer than usual as it is transferring the cache from the data registry to the LCache table.

The add-on also includes a cron entry that performs garbage collecting once a day.

LCache is currently in alpha so if something funky happens, please report it. If you find that your actions aren't being synced correctly or something feels "broken", simply comment out the back-end options in your config.php and rebuild the master data. That will resolve all issues.
Author
XenBot
Views
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from XenBot

Latest updates

  1. LCache Speed Up 1.0.4

    Fixed uninstalling issue!
Back
Top Bottom