diff --git a/Documentation/Filters/Cache.md b/Documentation/Filters/Cache.md index 1b7431575..a128c8fb1 100644 --- a/Documentation/Filters/Cache.md +++ b/Documentation/Filters/Cache.md @@ -71,8 +71,6 @@ type=filter module=cache hard_ttl=30 soft_ttl=20 -storage=... -storage_options=... rules=... ... @@ -95,10 +93,10 @@ sharing. ### Filter Parameters -The cache filter has one mandatory parameter - `storage` - and a few -optional ones. Note that it is advisable to specify `max_size` to prevent -the cache from using up all memory there is, in case there is very litte -overlap among the queries. +The cache filter has no mandatory parameters but a range of optional ones. +Note that it is advisable to specify `max_size` to prevent the cache from +using up all memory there is, in case there is very litte overlap among the +queries. #### `storage` @@ -108,6 +106,8 @@ argument. For instance: ``` storage=storage_inmemory ``` +The default is `storage_inmemory`. + See [Storage](#storage-1) for what storage modules are available. #### `storage_options` diff --git a/Documentation/Release-Notes/MaxScale-2.1.2-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.2-Release-Notes.md index 04bf2e4b9..4dd0d16c4 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.2-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.2-Release-Notes.md @@ -15,6 +15,11 @@ report at [Jira](https://jira.mariadb.org). ## Changed Features +### Cache + +* The storage `storage_inmemory` is now the default, so the parameter + `storage` no longer need to be set explicitly. + ### Improved Wildcard Matching The MySQLAuth module now supports all types of wildcards for both IP addresses diff --git a/server/modules/filter/cache/cachefilter.cc b/server/modules/filter/cache/cachefilter.cc index ee503d839..4d8f7ba8f 100644 --- a/server/modules/filter/cache/cachefilter.cc +++ b/server/modules/filter/cache/cachefilter.cc @@ -153,8 +153,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE() { "storage", MXS_MODULE_PARAM_STRING, - NULL, - MXS_MODULE_OPT_REQUIRED + CACHE_DEFAULT_STORAGE }, { "storage_options", diff --git a/server/modules/filter/cache/cachefilter.h b/server/modules/filter/cache/cachefilter.h index 5e29590e7..ba7b8636f 100644 --- a/server/modules/filter/cache/cachefilter.h +++ b/server/modules/filter/cache/cachefilter.h @@ -56,6 +56,8 @@ #define CACHE_DEFAULT_THREAD_MODEL "shared" // Cacheable selects #define CACHE_DEFAULT_SELECTS "verify_cacheable" +// Storage +#define CACHE_DEFAULT_STORAGE "storage_inmemory" typedef enum cache_selects {