forked from rhubarbgroup/redis-cache
-
Notifications
You must be signed in to change notification settings - Fork 2
/
readme.txt
227 lines (131 loc) · 7.31 KB
/
readme.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
227
=== Redis Object Cache ===
Contributors: tillkruess
Donate link: https://www.paypal.me/tillkruss
Tags: redis, predis, hhvm, pecl, caching, cache, object cache, wp object cache, server, performance, optimize, speed, load, replication, clustering
Requires at least: 3.3
Tested up to: 4.5
Stable tag: 1.3.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication and clustering.
== Description ==
A persistent object cache backend powered by Redis. Supports [Predis](https://github.com/nrk/predis/), [HHVM's Redis extension](https://github.com/facebook/hhvm/tree/master/hphp/system/php/redis) and the [PECL Redis Extension](https://github.com/phpredis/phpredis).
To adjust the connection parameters, prefix cache keys or configure replication/clustering, please see [Other Notes](http://wordpress.org/extend/plugins/redis-cache/other_notes/).
Forked from Eric Mann's and Erick Hitter's [Redis Object Cache](https://github.com/ericmann/Redis-Object-Cache).
== Installation ==
For detailed installation instructions, please read the [standard installation procedure for WordPress plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
1. Make sure Redis in installed and running.
2. Install and activate plugin.
3. Enable the object cache under _Settings -> Redis_.
4. If necessary, adjust [connection parameters](http://wordpress.org/extend/plugins/redis-cache/other_notes/).
If you server doesn't support the [WordPress Filesystem API](https://codex.wordpress.org/Filesystem_API), you have to manually copy the `object-cache.php` file from the `/plugins/redis-cache/includes/` directory to the `/wp-content/` directory.
== Connection Parameters ==
By default the object cache drop-in will connect to Redis over TCP at `127.0.0.1:6379` and select database `0`.
To adjust the connection parameters, define any of following constants in your `wp-config.php` file.
* `WP_REDIS_CLIENT` [default: not set]
Specifies the client used to communicate with Redis. Supports `hhvm`, `pecl` and `predis`.
* `WP_REDIS_SCHEME` [default: `tcp`]
Specifies the protocol used to communicate with an instance of Redis. Internally the client uses the connection class associated to the specified connection scheme. Supports `tcp` (TCP/IP), `unix` (UNIX domain sockets) or `http` (HTTP protocol through Webdis).
* `WP_REDIS_HOST` [default: `127.0.0.1`]
IP or hostname of the target server. This is ignored when connecting to Redis using UNIX domain sockets.
* `WP_REDIS_PORT` [default: `6379`]
TCP/IP port of the target server. This is ignored when connecting to Redis using UNIX domain sockets.
* `WP_REDIS_PATH` [default: not set]
Path of the UNIX domain socket file used when connecting to Redis using UNIX domain sockets.
* `WP_REDIS_DATABASE` [default: `0`]
Accepts a numeric value that is used to automatically select a logical database with the `SELECT` command.
* `WP_REDIS_PASSWORD` [default: not set]
Accepts a value used to authenticate with a Redis server protected by password with the `AUTH` command.
== Configuration Parameters ==
To adjust the configuration, define any of the following constants in your `wp-config.php` file.
* `WP_CACHE_KEY_SALT` [default: not set]
Set the prefix for all cache keys. Useful in setups where multiple installs share a common `wp-config.php` or `$table_prefix`, to guarantee uniqueness of cache keys.
* `WP_REDIS_MAXTTL` [default: not set]
Set maximum time-to-live (in seconds) for cache keys with an expiration time of `0`.
== Replication & Clustering ==
To use Replication and Clustering, make sure your server is running PHP7, your setup is using Predis to connect to Redis and you consulted the [Predis documentation](https://github.com/nrk/predis).
For replication, use the `WP_REDIS_SERVERS` constant and for clustering the `WP_REDIS_CLUSTER` constant. You can use a named array or an URI string to specify the parameters.
__Master-Slave Replication Example:__
define( 'WP_REDIS_SERVERS', [
'tcp://127.0.0.1:6379?database=15&alias=master',
'tcp://127.0.0.2:6379?database=15&alias=slave-01',
] );
__Clustering via Client-side Sharding Example:__
define( 'WP_REDIS_CLUSTER', [
'tcp://127.0.0.1:6379?database=15&alias=node-01',
'tcp://127.0.0.2:6379?database=15&alias=node-02',
] );
== Screenshots ==
1. Plugin settings page.
== Changelog ==
= 1.3.2 =
* Make sure `$result` is not `false` in `WP_Object_Cache::get()`
= 1.3.1 =
* Fixed connection issue
= 1.3 =
* New admin interface
* Added support for `wp_cache_get()`'s `$force` and `$found` parameter
* Added support for clustering and replication with Predis
= 1.2.3 =
* UI improvements
= 1.2.2 =
* Added `redis_object_cache_set` action
* Added `redis_object_cache_get` action and filter
* Prevented duplicated admin status messages
* Load bundled Predis library only if necessary
* Load bundled Predis library using `WP_CONTENT_DIR` constant
* Updated `stats()` method output to be uniform with WordPress
= 1.2.1 =
* Added `composer.json`
* Added deactivation and uninstall hooks to delete `object-cache.php`
* Added local serialization functions for better `advanced-cache.php` support
* Updated bundled Predis version to `1.0.3`
* Updated heading structure to be semantic
= 1.2 =
* Added Multisite support
* Moved admin menu under _Settings_ menu
* Fixed PHP notice in `get_redis_client_name()`
= 1.1.1 =
* Call `select()` and optionally `auth()` if HHVM extension is used
= 1.1 =
* Added support for HHVM's Redis extension
* Added support for PECL Redis extension
* Added `WP_REDIS_CLIENT` constant, to set prefered Redis client
* Added `WP_REDIS_MAXTTL` constant, to force expiration of cache keys
* Improved `add_or_replace()`, `get()`, `set()` and `delete()` methods
* Improved admin screen styles
* Removed all internationalization/localization from drop-in
= 1.0.2 =
* Added "Flush Cache" button
* Added support for UNIX domain sockets
* Improved cache object retrieval performance significantly
* Updated bundled Predis library to version `1.0.1`
= 1.0.1 =
* Load plugin translations
* Hide global admin notices from non-admin users
* Prevent direct file access to `redis-cache.php` and `admin-page.php`
* Colorize "Disable Object Cache" button
* Call `Predis\Client->connect()` to avoid potential uncaught `Predis\Connection\ConnectionException`
= 1.0 =
* Initial release
== Upgrade Notice ==
= 1.3.2 =
This update includes a critical fix for PhpRedis.
= 1.3.1 =
This update includes a critical connection issue fix.
= 1.3 =
This update includes a new admin interface and support for clustering and replication with Predis.
= 1.2.3 =
This updated includes several UI improvements.
= 1.2.2 =
This updated includes several bug fixes and improvements.
= 1.2.1 =
This update includes several improvements and compatibility fixes.
= 1.1.1 =
This update fixes critical bugs with the HHVM extension
= 1.1 =
This update includes bug fixes and adds supports for HHVM/PECL Redis extensions.
= 1.0.2 =
This update includes significant speed improvements and support for UNIX domain sockets.
= 1.0.1 =
This update includes several security, user interface and general code improvements.