CaRP Evolution Box
Web This Site

CaRP: Caching RSS Parser - Documentation

CaRP Interactive FAQ
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates

Cache Control Settings

Global Cache Settings | Flat File Cache Settings | mySQL Cache Settings

Global Cache Settings
cache-method [CaRP >= 3.5.8] : Use this setting to select whether to store cache data in flat files or mySQL database tables. The default value is "file". To use mySQL, use the value "mysql" (lowercase). Use the CaRP installation script to create the database tables. See an example in the mySQL cache settings section below.

cacheinterval: The number of minutes before the cached file expires and the remote RSS feed is refetched. The default value is 60 minutes.

	require_once '/path/to/carp.php';
	CarpConf('cacheinterval',120); // refresh the cache every 2 hours
cacheerrorwait: The number of minutes to wait before refreshing the cache if an error occurs while attempting to fetch or parse it. The default is 30 minutes. Note that when using the cachetime setting below, this could result in the cache not being updated for an entire day.

	require_once '/path/to/carp.php';
	CarpConf('cacheinterval',15); // wait 15 minutes after an error before trying again
cachetime: The time of day after which the cached file expires and the remote RSS feed is refetched. If this is blank (the default), cacheinterval is used instead. If this is set, cacheinterval is ignored. Specify the time as "H:M", where "H" is the hour in 24 hour format, and "M" is the minute. Be sure to specify the time in your server's time zone, which may be different from your time zone.

	require_once '/path/to/carp.php';
	CarpConf('cachetime','8:30'); // refresh after 8:30 am, in your server's timezone
cachefunctions: An array containing the names of the functions that return the paths to the cache folders. Most people will never need to change this option. Use it if you are building a system that needs to completely alter the cache directory structure.

Flat File Cache Settings
cachepath: The path to the directory where your cache directories will be located. Most people will never need to change this option. See also cacherelative below.

cacherelative: This setting controls how CaRP interprets the value of cachepath. Most people will never need to change this option. Valid values are:

	require_once '/path/to/carp.php';
mySQL Cache Settings
NOTE: The installation script will give you the code for the following settings based on the information you input. We recommend putting this code in your carpconf.php file rather than in each page where you use CaRP.

mysql-database [CaRP >= 3.5.8] : The name of the mySQL database that contains the cache tables.

mysql-connection [CaRP >= 3.5.8] : If a mySQL connection ID is stored in this setting, CaRP will use it to access the mySQL database. If it is set to "0", CaRP will use the last mySQL connection that was opened. If it is set to the default value of FALSE, you must set "mysql-connect" to "1" and set the other necessary settings to enable CaRP to open a connection.

mysql-connect [CaRP >= 3.5.8] : Tells CaRP whether to open a connection to mySQL or use an existing connection. Valid values are:
mysql-select-db [CaRP >= 3.6.1] : Tells CaRP whether to select the database to be used for caching, or whether to indicate the database name in the query. Valid values are:
mysql-host [CaRP >= 3.5.8] : The hostname to use to connect to mySQL.

mysql-username [CaRP >= 3.5.8] : The username to use to log in to mySQL.

mysql-password [CaRP >= 3.5.8] : The password to use to log in to mySQL.

mysql-lock-timeout [CaRP >= 3.5.8] : The maximum number of seconds to wait while attempting to obtain a database lock when updating the cache. The default is 10 seconds.

mysql-tables [CaRP >= 3.5.8] : An array containing the names of the three cache tables. The first array member ($carpconf['mysql-tables'][0]) is the aggregate cache and defaults to "carpaggregatecache". The second array member ($carpconf['mysql-tables'][1]) is the manual cache and defaults to "carpmanualcache". The third array member ($carpconf['mysql-tables'][2]) is the auto cache and defaults to "carpautocache".

	require_once '/path/to/carp.php';