purge_all() and purge_by_definition() look in the configuration
for which caches are available and then creates them to purge them.
The configuration stores the values used by initialise(), not
initialise_unit_test_instance() and would therefore fail to purge
all caches if they were not purged by another means.
In the case of filestore, it's purged by unit tests, in the case
of memcache(d), it purges the whole store when a single definition
is requested.
Therefore all configuration was moved into the configuration file
during unit tests and does not have any special override codes in
the unit test infrastructure.
This code was originally taken from; https://github.com/durana/moodle-cachestore_redis
Special thanks to Mark Nielsen and Adam Durana for their work on this.
Since the original import;
- Mode session support has been added.
- Some cleanup of names has been made.
- Data guarantee and references support was added.
Static cache has a very flexible storage capability
and does not need all the checks performed on it.
Enabling dereferencing handling and multiple identifiers
removes a lot of unneeded overhead for request caches that
have many get calls.
The changes were modelled on the static acceleration changes
done in MDL-53208.
When added a memcached instance you can now select whether the cache is
being shared by other applications. The setting will determine the
purging strategy.
Shared caches will have individual keys deleted while dedicated caches
will have the entire cache purged (better performance over networks).
Note: This option only works with the correct version of the php
memcached extension and with the multi-site safe changes.
If the cache does all the dereferencing when it stores and loads
the objects, then the cache loaders don't need to do that work.
This is true of all caches that use something other than PHP's memory
to store their results.
version = planned 2015051100 release version
requires= current 2015050500 rc1 version
Note: On purpose, the course format social wrong version (2015102100)
has been kept unmodified. Looking forward a solution right now.
Cache stores are now responsible for deciding if they are suitable
for use as the primary cache store during unit and acceptance tests
Changes are as follows:
* New method: cache_store::ready_to_be_used_for_testing
* Core cache store have been updated to override this method as
required.
* MongoDB usesafe default changed to true to match actual default
behaviour.
If you configured your site to run mongo unit tests and had
the mongo extension and backend installed but did not have the
mongo service running you would get a fatal error when running
the unit tests.
That problem has been fixed by checking the mongo test instance
is ready before returning it.
For stores where there is a very high rate of sets compared to gets, it
is beneficial to retrieve from the local server, skipping the network
overhead, at the expense of having to set many severs when a key is set.
This patch adds a memcache option to enable clustering. When on, only
one "server" is allowed, which will be where fetches are from, while
sets/updates/deletes/purges will occur to the all the servers in the
"set server" list.
To run unit tests, define TEST_CACHESTORE_MEMCACHE_TESTSERVERS with
multiple (return delimited) servers.
For stores where there is a very high rate of sets compared to gets, it
is beneficial to retrieve from the local server, skipping the network
overhead, at the expense of having to set many severs when a key is set.
This patch adds a memcached option to enable clustering. When on, only
one "server" is allowed, which will be where fetches are from, while
sets/updates/deletes/purges will occur to the all the servers in the
"set server" list.
To run unit tests, define TEST_CACHESTORE_MEMCACHED_TESTSERVERS with
multiple (return delimited) servers.