Skip to content
Gen2 edited this page May 23, 2017 · 2 revisions

Cache

Static files

You may have noticed that NPFchan uses “static” files for nearly everything — we only use .php files for stuff that requires immediate database interaction like posting, reporting, deleting and of course the entirety of the moderator interface. This is for performance reasons; static files load much faster than .php files, which query the database upon every single page load, wasting valuable processing power. Although you can create your own index.php to do whatever you like, NPFchan recommends the use of our themes system which builds .html files when an action occurs, such as posting.

APC, XCache, Redis and Memcached

On top of the static file caching system, you can enable the additional caching system which is designed to minimize SQL queries and can significantly increase speeds when posting or using the moderator interface.

APC and XCache are not available in PHP7. PHP7 is the recommended version of PHP to use. Although, if you desire, you may use APC or XCache on PHP5. Memcached is the (currently) recommended method of caching. Redis also appears to be available, but in my testing, I couldn't get it working.

APC

Install APC from your distribution's repository and add $config['cache']['enabled'] = 'apc'; to your instance-config.php

XCache

Install XCache and add $config['cache']['enabled'] = 'xcache'; to your instance-config.php

Memcached

Ensure that memcached is running at all times. Install it, and add

$config['cache']['enabled'] = 'memcached';

$config['cache']['memcached'] = array(
	array('localhost', 11211)
);

to your instance-config.php

Taken from Cache