WP Engine Sage Cache
Ensures that Sage's cache folders are present on a WP Engine environment even after restarts/reboots (GCP/AWS) and web-head cycling (AWS).
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/gartwpe/sage-cache-wpe/archive/refs/heads/main.zipEnsures that Sage's cache folders are present on a WP Engine environment even after restarts/reboots (GCP/AWS) and web-head cycling (AWS).
The code uses the WP Engine PWP_NAME variable (set in wp-config.php) to "know" where it is and generates a Sage cache directory accordingly - allowing copies between production/staging/development without sharing cached code.
Installation
-
Place inside
wp-content/mu-plugins/directory. -
Modify the Sage theme
compiledpath to:'compiled' => '/tmp/sage-cache-' . PWP_NAME,
For example, within...
wp-content/themes/YOUR_THEME/config/view.php
wp-content/themes/YOUR_THEME/vendor/roots/acorn/config/view.php
Usage
That's it! The Sage cache directrory will automatically regenerate in /tmp/sage-cache-INSTALL_NAME/* if not already present.
Contributing
Pull requests are welcome.