Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Project U-232
Reply
  #1  
Old 24th September 2021, 16:38
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Senior Member
 
Join Date: Jul 2013
P2P
Posts: 342
Default 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<br>";    
    }
    echo 
"<br>All servers have been flushed<br>";
    exit;
}

?>

<html>
<body>
Please be aware that flushing the cache can lead to performance problems and website slowness for a couple minutes!<br><br>
<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/
__________________
https://www.seedbox.io
https://www.vultr.com/
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 13:08. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.