Edit file File name : Memcached.html Content :<div ng-controller="A2OptMemcachedController" ng-if="vars.currentController == 'Memcached'"> <div class="panel panel-default" > <div class="panel-heading"> <ng-include src="'html_templates/Title.html'"></ng-include> </div> <div class="panel-body" ng-init="init()" > <!-- Memcached panel --> <div id="memcached_wrapper"> <div> <h4>Object Caching is designed to decrease database load in dynamic web applications. The following instances are available for this application:</h4> <h4><img src="resources/images/memcached-32.png" style="vertical-align: bottom;" /> Memcached</h4> <p ng-if=" vars.selectedApp.type == 'WordPress' ">Enabling Memcached for WordPress will automatically install and/or configure the A2 Optimized Object Cache and LiteSpeed Cache plugins.</p> <p ng-if=" vars.selectedApp.type == 'Drupal' || vars.selectedApp.type == 'Drupal 9' ">Enabling Memcached for Drupal will automatically install and/or configure the Drupal Memcached extension.</p> <p ng-if=" vars.selectedApp.type == 'Joomla' ">Enabling Memcached for Joomla will automatically install and/or configure the Joomla Memcached extension.</p> </div> <alert type="warning" ng-if="!litespeed" > Memcached is only available on the TurboServer platform. To order a package with Memcached: submit a ticket to Billing at <a href="https://my.a2hosting.com/submitticket.php" target="_blank" >my.a2hosting.com</a>. </alert> <div ng-if="memcached_count != null && memcached_count > 0"> <div class="panel panel-success" > <div class="panel-body"> <div class="pull-left"> <h4 style="margin:0">Memcached <span ng-if="vars.selectedApp.swiftcache.memcached.enabled === true" class="success">( Enabled )</span></h4> </div> <div class="pull-right" ng-if="!(vars.selectedApp.swiftcache.memcached.enabled === true)" > <button ng-if=" vars.selectedApp.type != 'WordPress' && vars.selectedApp.type != 'Drupal' && vars.selectedApp.type != 'Drupal 9' && vars.selectedApp.type != 'Joomla' " class="btn btn-success pull-right" ng-click="enable(vars.selectedApp)">Enable</button> <button ng-if=" vars.selectedApp.type == 'WordPress' " class="btn btn-success pull-right" ng-really-click="enable(vars.selectedApp)" ng-really-message="Enabling Memcached for WordPress will automatically install and/or configure the A2 Optimized Object Cache." >Enable</button> <button ng-if=" vars.selectedApp.type == 'Drupal' || vars.selectedApp.type == 'Drupal 9' " class="btn btn-success pull-right" ng-really-click="enable(vars.selectedApp)" ng-really-message="Enabling Memcached for Drupal will automatically install and/or configure the Drupal Memcached extension." >Enable</button> <button ng-if=" vars.selectedApp.type == 'Joomla' " class="btn btn-success pull-right" ng-really-click="enable(vars.selectedApp)" ng-really-message="Enabling Memcached for Joomla will automatically install and/or configure the Joomla Memcached extension." >Enable</button> </div> <div class="pull-right" ng-if="vars.selectedApp.swiftcache.memcached.enabled === true" > <button class="btn btn-danger pull-right" ng-click="disable(vars.selectedApp)">Disable</button> </div> <div style="clear:both"><p class="text-info">{{instance.socket}}</p></div> <div style="clear:both"></div> </div> </div> <div class="panel panel-info" ng-if="vars.selectedApp.swiftcache.memcached.enabled === true"> <div class="panel-heading">Memcached Statistics</div> <div class="panel-body" style="padding:0;"> <div > <div style="padding:5px" ng-if="instance.stats != null && (instance.stats.length === 0 || instance.stats.pid == null)"> <alert type="warning">The memcached server is down!"</alert> </div> <div ng-if="instance.stats != null && instance.stats.pid != null "> <table class="table"> <tr> <th >Connections: <i class="info glyphicon glyphicon-info-sign" style="cursor:pointer" tooltip="The total number of active connections to this Memcached instance." tooltip-placement="bottom"></i> </th> <td >{{instance.stats["curr_connections"]}}</td> </tr> <tr> <th>Hit Rate: <i class="info glyphicon glyphicon-info-sign" style="cursor:pointer" tooltip="The rate that items requested are served up from cache." tooltip-placement="bottom"></i> </th> <td>{{instance.stats["hit_rate"]}}%</td> </tr> <tr> <th>Eviction Rate: <i class="info glyphicon glyphicon-info-sign" style="cursor:pointer" tooltip="The rate that fresh items are deleted from the cache to make room for new items. If this number is high, you should increase the size of the instance." tooltip-placement="bottom"></i> </th> <td>{{instance.stats["eviction_rate"]}}%</td> </tr> <tr> <th>Memory Used: <i class="info glyphicon glyphicon-info-sign" style="cursor:pointer" tooltip="The amout of memory allocated to this instance and how much of it is being utilized." tooltip-placement="bottom"></i> </th> <td> <div > <progressbar max='100' value='instance.stats["mem_usage"]'><span style="color:black; white-space:nowrap;padding-left:20px">{{instance.stats["mem_usage"]}}% of {{instance.stats["limit_maxMB"]}}MB</span></progressbar> </div> </td> </tr> <tr> <th>Up Since: <i class="info glyphicon glyphicon-info-sign" style="cursor:pointer" tooltip="The last time the Memcached instance was restarted" tooltip-placement="bottom"></i> </th> <td>{{instance.stats["up_since"] | date:'d MMM, HH:mm'}}</td> </tr> </table> </div> <div> <div class="pull-right" style="margin:10px;" > <button class="btn btn-warning btn-sm" ng-click="reset_stats(instance)" tooltip="Zero out all the statistics for this Memcached instance." >Reset Stats</button> <button class="btn btn-success btn-sm" ng-click="get_stats(instance,true)" tooltip="Refresh the statistics for this Memcached instance.">Refresh Stats</button> <!--<button class="btn btn-warning btn-sm" ng-really-message="Are you sure you want to clear the memcached cache?" ng-really-click="flush_cache(instance)" tooltip="Delete all items stored in the cache and free up memory.">Flush Cache</button>--> <button class="btn btn-danger btn-sm" ng-really-message="Are you sure you want to restart memcached?" ng-really-click="restart(instance)" tooltip="Restart the memcached service.">Restart</button> </div> </div> <div style="clear:both"></div> </div> </div> </div> <div style="padding:20px 0 10px 0" ng-if="vars.selectedApp.swiftcache.memcached.enabled === true"> <div > <div> <p>In order to provide secure Memcached within a shared environment, Unix sockets have been utilized.</p> <p>The Unix socket for this instance is:</p><p><b>{{instance.socket}}</b></p> <p>To use this memcached instance in custom code: this Unix socket can be used like in this php example.</p> </div> <pre style="word-wrap:normal;margin:10px"> $memcache = new Memcache(); $memcache->addServer("{{instance.socket}}",0); $memcache->add("key","data"); $memcache->close(); </pre> </div> </div> </div> </div> <!-- End Memcached panel--> <!-- Redis panel --> <div id="redis_wrapper" ng-if="vars.selectedApp.swiftcache.memcached.redis_available"> <div> <h4>Redis</h4> <p ng-if="vars.selectedApp.type == 'WordPress'">Enabling Redis for WordPress will automatically install and/or configure the A2 Optimized Object Cache and LiteSpeed Cache plugins.{{ instance.redis_socket }}</p> </div> <div ng-if="memcached_count != null && memcached_count > 0"> <div class="panel panel-success" > <div class="panel-body"> <div class="pull-left"> <h4 style="margin:0">Redis <span ng-if="vars.selectedApp.swiftcache.memcached.redis_enabled === true" class="success">( Enabled )</span></h4> </div> <div class="pull-right" ng-if="!(vars.selectedApp.swiftcache.memcached.redis_enabled === true)" > <button class="btn btn-success pull-right" ng-really-click="enable_redis(vars.selectedApp)" ng-really-message="Enabling Redis for WordPress will automatically install and/or configure the A2 Optimized Object Cache." >Enable</button> </div> <div class="pull-right" ng-if="vars.selectedApp.swiftcache.memcached.redis_enabled === true" > <button class="btn btn-danger pull-right" ng-click="disable_redis(vars.selectedApp)">Disable</button> </div> <div style="clear:both"><p class="text-info">{{instance.redis_socket}}</p></div> <div style="clear:both"></div> </div> </div> <div style="padding:20px 0 10px 0" ng-if="vars.selectedApp.swiftcache.redis.enabled === true"> <div > <div> <p>In order to provide secure Redis within a shared environment, Unix sockets have been utilized.</p> <p>The Unix socket for this instance is:</p><p><b>{{instance.redis_socket}}</b></p> <p>To use this Redis instance in custom code: this Unix socket can be used like in this php example.</p> </div> <pre style="word-wrap:normal;margin:10px"> $redis = new Redis(); $redis->connect("{{instance.redis_socket}}",0); $redis->set("key","data"); $redis->close(); </pre> </div> </div> </div> </div> <!-- End Redis panel--> </div> </div> </div>Save