CACHEDB_SQL module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”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.
Advantages
Section titled “Advantages”- 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
Limitations
Section titled “Limitations”- The module’s counter operations (ADD and SUB) are currently only supported by MySQL
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”None.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- none:
Exported Parameters
Section titled “Exported Parameters”db_url (string)
Section titled “db_url (string)”The url of the Database that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations.
...modparam("cachedb_sql", "db_url","mysql://localhost/my_database");......cache_store("sql","key","$ru value");cache_add("sql","counter",10);...db_table (string)
Section titled “db_table (string)”The table of the Database that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations.
...modparam("cachedb_sql", "db_table","my_table");...key_column (string)
Section titled “key_column (string)”The column where the key will be stored
...modparam("cachedb_sql", "key_column","some_name");...value_column (string)
Section titled “value_column (string)”The column where the value will be stored
...modparam("cachedb_sql", "value_column","some_name");...counter_column (string)
Section titled “counter_column (string)”The column where the counter value will be stored
...modparam("cachedb_sql", "counter_column","some_name");...expires_column (string)
Section titled “expires_column (string)”The column where the expires will be stored
...modparam("cachedb_sql", "expires_column","some_name");...cache_clean_period (int)
Section titled “cache_clean_period (int)”The interval in seconds at which the expired keys will be removed from the database. Default value is 60 ( seconds )
...modparam("cachedb_sql", "cache_clean_period",10);...Exported Functions
Section titled “Exported Functions”The module does not export functions to be used in configuration script.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Vlad Paiu (@vladpaiu) | 11 | 3 | 829 | 3 |
| 2. | Stefan Darius (@dariusstefan) | 7 | 4 | 197 | 21 |
| 3. | Razvan Crainea (@razvancrainea) | 3 | 1 | 1 | 1 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jun 2026 - Jun 2026 |
| 3. | Vlad Paiu (@vladpaiu) | Jan 2013 - Aug 2013 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Vlad Paiu (@vladpaiu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0