 |
|
BamBam0077 |
24th September 2021 16:38 |
flush memcache
https://github.com/TheLastCicada/flu...h-memcache.php
PHP Code:
<?php
/**
* This file simply provides the user with a button to flush the memcache servers
*
* author: Zachary Brown
*/
//Array of server:port
$memcache_servers = array('127.0.0.1:11211');
if($_POST['submit']){
foreach($memcache_servers as $memserv){
$memparts = explode(':',$memserv);
$servername = $memparts[0];
$serverport = $memparts[1];
$memcache_obj = memcache_connect($servername,$serverport);
if(!$memcache_obj){die("Could not connect to memcache server $servername");}
if(!(memcache_flush($memcache_obj))){die("Could not flush cache of $servername");}
echo "Flush of $servername successful";
}
echo "All servers have been flushed";
exit;
}
?>
<html>
<body>
Please be aware that flushing the cache can lead to performance problems and website slowness for a couple minutes!
<form method="post" action="flush-memcache.php">
<input name="submit" type="submit" value="FLUSH CACHE">
</form>
</body></html>
SAVE AS flush-memcache.php into directory folder /var/www/html/
|
All times are GMT +2. The time now is 17:04. |
|
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2025, vBulletin Solutions Inc.