Tags
Category
Control Panel
Tag Database
Needs Improvment
Status
- Monit
- Restarting MySQL + Algorithm
- Caching
- Known Issues
- Cache TTL (Time to Live) and wp_nonces
- Nginx Helper Plugin
- Nginx Helper Addition Code Snippets
- Clear cache as Editor
- Clear cache on Plugin Updates
- Changelog
Monit
Restarting MySQL + Algorithm
Monit will restart MySQL if it exceeds a certain amount of memory usage.
Here’s the algorithm
If ram_MB > 1500 then kill at 500MB
If ram_MB =< 1500 then kill at 9172MB (70% Memory in MB/2)
If ram_MB =< 8000 then kill at 11793MB (80% memory in MB/2)
If ram_MB =< 1600 then kill at 13104MB (50% memory in MB)
Caching
Known Issues
Cache TTL (Time to Live) and wp_nonces
The default TTL for GridPane caching (Redis/FastCGI) is super high. This causes issues with cached pages that use wp_nonces. Here's a list of plugins or themes that have issues.
- Divi Contact Forms
The resolution is to set the Cache TTL to 12 hours minimum.
Nginx Helper Plugin
Nginx Helper Addition Code Snippets
Clear cache as Editor
Clear cache on Plugin Updates
You can see the code example on the GridPane knowledge base https://gridpane.com/kb/purge-via-nginx-helper-hooks/
However, it's not on git so the author Ken may have updated it. Here is the code just in-case you don't want to click through.
//* Nginx Helper Enhancement
function nhpcau_upgrader_process_complete()
{
global $nginx_purger;
if(isset($nginx_purger))
{
$nginx_purger->purge_all();
}
}
// After plugins have been updated
add_action( 'upgrader_process_complete', 'nhpcau_upgrader_process_complete', 10, 0 );
// After a plugin has been activated
add_action( 'activated_plugin', 'nhpcau_upgrader_process_complete', 10, 0);
// After a plugin has been deactivated
add_action( 'deactivated_plugin', 'nhpcau_upgrader_process_complete', 10, 0);
// After a theme has been changed
add_action( 'switch_theme', 'nphcau_upgrader_process_complete', 10, 0);
Changelog
- 12-09-2021 Added link to editor role cache purging code snippet