-
Notifications
You must be signed in to change notification settings - Fork 18
/
advanced-cache.txt
226 lines (206 loc) · 6.76 KB
/
advanced-cache.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?php
/**
* Advanced cache stub.
*
* @since 150422 Rewrite.
*/
namespace WebSharks\CometCache;
if (!defined('WPINC')) {
exit('Do NOT access this file directly: '.basename(__FILE__));
}
if (!defined('COMET_CACHE_PLUGIN_FILE')) {
/**
* Plugin file path.
*
* @since 140725 Reorganizing class members.
*
* @var string Absolute server path to CC plugin file.
*/
define('COMET_CACHE_PLUGIN_FILE', '%%COMET_CACHE_PLUGIN_FILE%%');
}
if (defined('WP_DEBUG') && WP_DEBUG) {
if ((include_once(dirname(COMET_CACHE_PLUGIN_FILE).'/src/includes/stub.php')) === false) {
return; // Unable to find stub. Fail softly w/ PHP warning.
}
} elseif ((@include_once(dirname(COMET_CACHE_PLUGIN_FILE).'/src/includes/stub.php')) === false) {
return; // Unable to find stub. Fail softly.
}
if (defined('WP_DEBUG') && WP_DEBUG) {
if ((@include_once(dirname(COMET_CACHE_PLUGIN_FILE).'/src/includes/functions/wp-cache-postload.php')) === false) {
return; // Unable to find postload function(s). Fail softly w/ PHP warning.
}
} elseif ((@include_once(dirname(COMET_CACHE_PLUGIN_FILE).'/src/includes/functions/wp-cache-postload.php')) === false) {
return; // Unable to find postload function(s). Fail softly.
}
AdvCacheBackCompat::zenCacheConstants();
AdvCacheBackCompat::zcRequestVars();
if (!defined('COMET_CACHE_PRO')) {
/**
* Comet Cache Pro flag.
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_PRO', IS_PRO);
}
if (!defined('COMET_CACHE_ENABLE')) {
/**
* Is Comet Cache enabled?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_ENABLE', '%%COMET_CACHE_ENABLE%%');
}
if (!defined('COMET_CACHE_DEBUGGING_ENABLE')) {
/**
* Is Comet Cache debugging enabled?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_DEBUGGING_ENABLE', '%%COMET_CACHE_DEBUGGING_ENABLE%%');
}
if (!defined('COMET_CACHE_ALLOW_BROWSER_CACHE')) {
/**
* Allow browsers to cache each document?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*
* @note If this is a `FALSE` (or an empty) value; Comet Cache will send no-cache headers.
* If `TRUE`, Comet Cache will NOT send no-cache headers.
*/
define('COMET_CACHE_ALLOW_BROWSER_CACHE', '%%COMET_CACHE_ALLOW_BROWSER_CACHE%%');
}
if (!defined('COMET_CACHE_GET_REQUESTS')) {
/**
* Cache `$_GET` requests w/ a query string?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_GET_REQUESTS', '%%COMET_CACHE_GET_REQUESTS%%');
}
if (!defined('COMET_CACHE_CACHE_404_REQUESTS')) {
/**
* Cache 404 errors?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_CACHE_404_REQUESTS', '%%COMET_CACHE_CACHE_404_REQUESTS%%');
}
if (!defined('COMET_CACHE_CACHE_NONCE_VALUES')) {
/**
* Cache HTML containing nonce values?
*
* @since 160103 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_CACHE_NONCE_VALUES', '%%COMET_CACHE_CACHE_NONCE_VALUES%%');
}
if (!defined('COMET_CACHE_CACHE_NONCE_VALUES_WHEN_LOGGED_IN')) {
/**
* Cache HTML containing nonce values for Logged-In Users?
*
* @since 160103 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_CACHE_NONCE_VALUES_WHEN_LOGGED_IN', '%%COMET_CACHE_CACHE_NONCE_VALUES_WHEN_LOGGED_IN%%');
}
if (!defined('COMET_CACHE_FEEDS_ENABLE')) {
/**
* Cache XML/RSS/Atom feeds?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_FEEDS_ENABLE', '%%COMET_CACHE_FEEDS_ENABLE%%');
}
if (!defined('COMET_CACHE_DIR')) {
/**
* Directory used to store cache files; relative to `WP_CONTENT_DIR`.
*
* @since 140422 First documented version.
*
* @var string Absolute server directory path.
*/
define('COMET_CACHE_DIR', WP_CONTENT_DIR.'/'.'%%COMET_CACHE_DIR%%');
}
if (!defined('COMET_CACHE_MAX_AGE')) {
/**
* Cache expiration time.
*
* @since 140422 First documented version.
*
* @var string Anything compatible with PHP's {@link \strtotime()}.
*/
define('COMET_CACHE_MAX_AGE', '%%COMET_CACHE_MAX_AGE%%');
}
if (!defined('COMET_CACHE_EXCLUDE_URIS')) {
/**
* URI exclusions.
*
* @since 140422 First documented version.
*
* @var string A regular expression; else an empty string.
*/
define('COMET_CACHE_EXCLUDE_URIS', '%%COMET_CACHE_EXCLUDE_URIS%%');
}
if (!defined('COMET_CACHE_EXCLUDE_CLIENT_SIDE_URIS')) {
/**
* Client-side URI exclusions.
*
* @since 151220 Adding support for client-side URI exclusions.
*
* @var string A regular expression; else an empty string.
*/
define('COMET_CACHE_EXCLUDE_CLIENT_SIDE_URIS', '%%COMET_CACHE_EXCLUDE_CLIENT_SIDE_URIS%%');
}
if (!defined('COMET_CACHE_EXCLUDE_REFS')) {
/**
* HTTP referrer exclusions.
*
* @since 140422 First documented version.
*
* @var string A regular expression; else an empty string.
*/
define('COMET_CACHE_EXCLUDE_REFS', '%%COMET_CACHE_EXCLUDE_REFS%%');
}
if (!defined('COMET_CACHE_EXCLUDE_AGENTS')) {
/**
* HTTP user-agent exclusions.
*
* @since 140422 First documented version.
*
* @var string A regular expression; else an empty string.
*/
define('COMET_CACHE_EXCLUDE_AGENTS', '%%COMET_CACHE_EXCLUDE_AGENTS%%');
}
if (!defined('COMET_CACHE_404_CACHE_FILENAME')) {
/**
* 404 file name (if applicable).
*
* @since 140422 First documented version.
*
* @var string A unique file name that will not conflict with real paths.
* This should NOT include the extension; basename only please.
*/
define('COMET_CACHE_404_CACHE_FILENAME', '----404----');
}
$GLOBALS[GLOBAL_NS.'_advanced_cache'] = new AdvancedCache();
$GLOBALS[GLOBAL_NS.'__advanced_cache'] = &$GLOBALS[GLOBAL_NS.'_advanced_cache'];
if (!isset($GLOBALS['zencache__advanced_cache'])) {
$GLOBALS['zencache_advanced_cache'] = &$GLOBALS[GLOBAL_NS.'_advanced_cache'];
$GLOBALS['zencache__advanced_cache'] = &$GLOBALS[GLOBAL_NS.'_advanced_cache'];
}