wearerequired / translations-cache
Reduces file reads for translations by caching the first read via APCu.
Installs: 1 782
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 0
Open Issues: 0
Type:wordpress-muplugin
Requires
- php: >=8.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7 || ^1.0
- wearerequired/coding-standards: ^6.0
This package is auto-updated.
Last update: 2024-12-19 13:42:26 UTC
README
Simple WordPress must-use plugin to reduce file reads for gettext (.mo) and JavaScript (.json) translations by caching the first read via APCu.
By default the cache TTL is set to six hours without any automated cache invalidation. You can set the TRANSLATIONS_CACHE_KEY_SALT
environment variable to change the key for the cache which will force the plugin to read from a fresh cache entry.
Installation
- Define the dropin path for
wordpress-muplugin
composer config --json --merge extra.dropin-paths '{ "wordpress/content/mu-plugins/": [ "type:wordpress-muplugin" ] }'
- Install
koodimonni/composer-dropin-installer
andwearerequired/translations-cache
composer require koodimonni/composer-dropin-installer wearerequired/translations-cache
Example of a composer.json
for a site:
{ "name": "wearerequired/something", "require": { "koodimonni/composer-dropin-installer": "^1.0", "wearerequired/translations-cache": "^1.0" }, "extra": { "dropin-paths": { "wordpress/content/mu-plugins/": [ "type:wordpress-muplugin" ] } } }