Sources for file docs/cache.txt in version 3.0
Click on a comment to hide it. Click here to show all comments.
CACHING/HTML Generation
/**
* HTML Cache
*
* Xnyo's inbuilt cache lets you store the contents of your generated HTML pages for set
* periods of time (ie a page that only recreates itself once a day). It also allows you
* to generate static html files to be stored somewhere else.
**/
Required Files
plugins/cache/*
Configuration
Cache Handler
This variable determines the cache handler to use for caching. This must match a valid cache
plugin.
Default:
(string) file
Examples:
// Use the file cache handler
$xnyo->cache_handler = 'file';
// Use the database cache handler
$xnyo->cache_handler = 'db';
Load Cache
Whether or not to load the caching modules at all. No caching routines will be called if this is
false.
Default:
(bool) true
Examples:
// load cache routines
$xnyo->load_cache = 'true';
// don't load cache routines - we don't need them, therefore why waste the cycles loading them?
$xnyo->load_cache = 'false';
Cache
Whether to use the cache. This should be turned on for speed reasons after development.
Default:
(bool) false
Examples:
// turn on the cache.
$xnyo->cache = true;
Cache Expire
Date / Time that the cache file should expire. This should be a timestamp in the future or the
cache will always regenerate.
Default:
NULL
Example:
// expire on the first day of the next month
$xnyo->cache_expire =
// date/time (as unix timestamp) that cache file should expire
public $cache_expire;
// How many seconds a cache file should be valid for, ignored if $cache_expire != NULL
public $cache_lifetime = 86400;
// where to store cached data, depends on the cache handler, could be a directory, or a db table,
etc
public $cache_location = 'cache';
// generator! if you're using the file cache handler and this is set, xnyo will
// attempt to dump the contents of the cache to this file, in effect generating
// a static html page, or image, or whatever
public $cache_filename;
Methods
// Cache
'cache_plugin::_fetch_cache' => 'Cache: Fetch',
'cache_plugin::output_buffer_handler' => 'Cache: OB Handler',
Plugins
file
database
Advanced Usage Examples
Page Regen
Static Website Building
Debug Console
xnyo conf.
debug console.
