2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Core cache definitions.
20 * This file is part of Moodle's cache API, affectionately called MUC.
21 * It contains the components that are requried in order to use caching.
25 * @copyright 2012 Sam Hemelryk
26 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31 // Used to store processed lang files.
32 // The keys used are the component of the string file.
33 // The persistent max size has been based upon student access of the site.
35 'mode' => cache_store::MODE_APPLICATION,
39 'persistentmaxsize' => 30
42 // Used to store database meta information.
43 // The database meta information includes information about tables and there columns.
44 // Its keys are the table names.
45 // When creating an instance of this definition you must provide the database family that is being used.
46 'databasemeta' => array(
47 'mode' => cache_store::MODE_APPLICATION,
48 'requireidentifiers' => array(
52 'persistentmaxsize' => 15
55 // Event invalidation cache.
56 // This cache is used to manage event invalidation, its keys are the event names.
57 // Whenever something is invalidated it is both purged immediately and an event record created with the timestamp.
58 // When a new cache is initialised all timestamps are looked at and if past data is once more invalidated.
59 // Data guarantee is required in order to ensure invalidation always occurs.
60 // Persistence has been turned on as normally events are used for frequently used caches and this event invalidation
61 // cache will likely be used either lots or never.
62 'eventinvalidation' => array(
63 'mode' => cache_store::MODE_APPLICATION,
65 'requiredataguarantee' => true,
69 // Cache for question definitions. This is used by the question_bank class.
70 // Users probably do not need to know about this cache. They will just call
71 // question_bank::load_question.
72 'questiondata' => array(
73 'mode' => cache_store::MODE_APPLICATION,
74 'simplekeys' => true, // The id of the question is used.
75 'requiredataguarantee' => false,
76 'datasource' => 'question_finder',
77 'datasourcefile' => 'question/engine/bank.php',
80 // HTML Purifier cache
81 // This caches the html purifier cleaned text. This is done because the text is usually cleaned once for every user
82 // and context combo. Text caching handles caching for the combination, this cache is responsible for caching the
83 // cleaned text which is shareable.
84 // NOTE: this data may be safely stored in local caches on cluster nodes.
85 'htmlpurifier' => array(
86 'mode' => cache_store::MODE_APPLICATION,
89 // Used to store data from the config + config_plugins table in the database.
90 // The key used is the component:
91 // - core for all core config settings
92 // - plugin component for all plugin settings.
93 // Persistence is used because normally several settings within a script.
95 'mode' => cache_store::MODE_APPLICATION,
100 // Groupings belonging to a course.
101 // A simple cache designed to replace $GROUPLIB_CACHE->groupings.
102 // Items are organised by course id and are essentially course records.
103 'groupdata' => array(
104 'mode' => cache_store::MODE_APPLICATION,
105 'simplekeys' => true, // The course id the groupings exist for.
106 'simpledata' => true, // Array of stdClass objects containing only strings.
107 'persistent' => true, // Likely there will be a couple of calls to this.
108 'persistmaxsize' => 2, // The original cache used 1, we've increased that to two.
111 // Used to cache calendar subscriptions.
112 'calendar_subscriptions' => array(
113 'mode' => cache_store::MODE_APPLICATION,
114 'simplekeys' => true,
115 'simpledata' => true,
116 'persistent' => true,
120 // This stores the YUI module metadata for Shifted YUI modules in Moodle.
121 'yuimodules' => array(
122 'mode' => cache_store::MODE_APPLICATION,
125 // Cache for the list of event observers.
126 'observers' => array(
127 'mode' => cache_store::MODE_APPLICATION,
128 'simplekeys' => true,
129 'simpledata' => true,
130 'persistent' => true,
131 'persistentmaxsize' => 2,
134 // Cache used by the {@link plugininfo_base} class.
135 'plugininfo_base' => array(
136 'mode' => cache_store::MODE_APPLICATION,
137 'simplekeys' => true,
138 'simpledata' => true,
139 'persistent' => true,
140 'persistentmaxsize' => 2,
143 // Cache used by the {@link plugininfo_mod} class.
144 'plugininfo_mod' => array(
145 'mode' => cache_store::MODE_APPLICATION,
146 'simplekeys' => true,
147 'simpledata' => true,
148 'persistent' => true,
149 'persistentmaxsize' => 1,
152 // Cache used by the {@link plugininfo_block} class.
153 'plugininfo_block' => array(
154 'mode' => cache_store::MODE_APPLICATION,
155 'simplekeys' => true,
156 'simpledata' => true,
157 'persistent' => true,
158 'persistentmaxsize' => 1,
161 // Cache used by the {@link plugininfo_filter} class.
162 'plugininfo_filter' => array(
163 'mode' => cache_store::MODE_APPLICATION,
164 'simplekeys' => true,
165 'simpledata' => true,
166 'persistent' => true,
167 'persistentmaxsize' => 1,
170 // Cache used by the {@link plugininfo_repository} class.
171 'plugininfo_repository' => array(
172 'mode' => cache_store::MODE_APPLICATION,
173 'simplekeys' => true,
174 'simpledata' => true,
175 'persistent' => true,
176 'persistentmaxsize' => 1,
179 // Cache used by the {@link plugininfo_portfolio} class.
180 'plugininfo_portfolio' => array(
181 'mode' => cache_store::MODE_APPLICATION,
182 'simplekeys' => true,
183 'simpledata' => true,
184 'persistent' => true,
185 'persistentmaxsize' => 1,
188 // Used to store the full tree of course categories
189 'coursecattree' => array(
190 'mode' => cache_store::MODE_APPLICATION,
191 'persistent' => true,
192 'invalidationevents' => array(
193 'changesincoursecat',
196 // Used to store data for course categories visible to current user. Helps to browse list of categories
197 'coursecat' => array(
198 'mode' => cache_store::MODE_SESSION,
199 'persistent' => true,
200 'invalidationevents' => array(
201 'changesincoursecat',
206 // Used to store data for course categories visible to current user. Helps to browse list of categories
207 'coursecatrecords' => array(
208 'mode' => cache_store::MODE_REQUEST,
209 'simplekeys' => true,
210 'persistent' => true,
211 'invalidationevents' => array(
212 'changesincoursecat',
215 // Cache course contacts for the courses
216 'coursecontacts' => array(
217 'mode' => cache_store::MODE_APPLICATION,
218 'persistent' => true,
219 'simplekeys' => true,
221 // Used to store data for repositories to avoid repetitive DB queries within one request
222 'repositories' => array(
223 'mode' => cache_store::MODE_REQUEST,
224 'persistent' => true,