Git Product home page Git Product logo

relay-wp-l10n's Introduction

WordPress Localization cache using Relay

Use Relay to store WordPress translation in PHP runtime memory.

Installation

Install as plugin, or Must-Use plugin.

Composer installation

To install the plugin using Composer, add the repository to your composer.json:

{
  "repositories": [
    { "type": "vcs", "url": "[email protected]:cachewerk/relay-wp-l10n.git" }
  ],
}

Then simply run:

composer require cachewerk/relay-wp-l10n

Caveats

  1. If RELAY_L10N_CONFIG is not set, the plugin will do nothing
  2. Translations are invalidated using FLUSHDB, be sure to set a dedicated database for translations so it won't flush the regular object cache as well
  3. Relay's Table class currently caches data on a per-worker basis, so the cache needs to warm up for all workers in a FPM pool

Configuration

Add the RELAY_L10N_CONFIG constant to your wp-config.php.

define('RELAY_L10N_CONFIG', [
    'host' => $_SERVER['CACHE_HOST'],
    'port' => $_SERVER['CACHE_PORT'],
    'database' => $_SERVER['CACHE_DB'] + 1,
    'password' => $_SERVER['CACHE_PASSWORD'],
] );

Default configuration

Option Default Description
scheme tcp
host 127.0.0.1
port 6379
database 0
username
password
prefix
timeout 0.5
read_timeout 0.5
backoff smart Supports: none, smart
retries 3
retry_interval 20
tls_options false
persistent false Whether to use a persistent connection
footnote true Whether to print a HTML comment with statistics

relay-wp-l10n's People

Contributors

tillkruss avatar

Watchers

 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.