Coder Social home page Coder Social logo

ethitter / redis-object-cache-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rhubarbgroup/redis-cache

0.0 0.0 0.0 181 KB

A persistent object cache backend powered by Redis. Supports HHVM's Redis extension, the PECL Redis Extension and the Predis library for PHP.

Home Page: https://wordpress.org/plugins/redis-cache/

CSS 0.18% PHP 99.82%

redis-object-cache-1's Introduction

Redis Object Cache for WordPress

A persistent object cache backend powered by Redis. Supports HHVM's Redis extension, the PECL Redis Extension and the Predis library for PHP.

Forked from Eric Mann's and Erick Hitter's Redis Object Cache.

Installation

For detailed installation instructions, please read the standard installation procedure for WordPress 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.

If you server doesn't support the WordPress 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.

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

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

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',
] );

redis-object-cache-1's People

Contributors

carlalexander avatar pnu avatar rohmann avatar scott-kennedy avatar tillkruss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.