Table of Contents
List of Examples
This module is an implementation of a cache system designed to work with a regular SQL-based server. It uses the internal DB interface to connect to the back-end, and also implements the Key-Value interface exported from the core.
memory costs are no longer on the server
the cache is 100% persistent. A restart of OpenSIPS server will not affect the DB. The DB is also persistent so it can also be restarted without loss of information.
Multiple OpenSIPS instances can easily share key-value information via a regular SQL-based database
The module's counter operations ( ADD and SUB ) are currently only supported by MySQL
The url of the Database that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations.
Example 1.1. Set db_url
parameter
... modparam("cachedb_sql", "db_url","mysql://localhost/my_database"); ...
Example 1.2. Usage example
... cache_store("sql","key","$ru value"); cache_add("sql","counter",10); ...
The table of the Database that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations.
The column where the key will be stored
The column where the value will be stored
Example 1.5. Set value_column
parameter
... modparam("cachedb_sql", "value_column","some_name"); ...
The column where the counter value will be stored
Example 1.6. Set counter_column
parameter
... modparam("cachedb_sql", "counter_column","some_name"); ...
The column where the expires will be stored
Example 1.7. Set expires_column
parameter
... modparam("cachedb_sql", "expires_column","some_name"); ...