2.2.2. Memcache(d)

Memcache(d) is a service for caching data in RAM. Designed to speed up web applications by leveling the unnecessary load on the database. Allows you to store key—value pairs in memory for small amounts of data (strings, objects) received from the database, API calls, pre—formation of web page content (anything that takes extra time to execute and can be cached). Simply put, Memcache(d) is caching site pages not to disk (or to a database), but to RAM.

Important points:

  • The ordered volume is allocated to the entire hosting account without division by site. The maximum total volume is 512 MB.
  • On businesshosting Memcache (d) does not need to be ordered. It is available free of charge within the allocated amount of RAM.
  1. Open the section "Hosting".
  2. In the block "Extra services" click "Memcache":
  3. In the drop-down list, select the required amount of memory and click "To order" (if the system informs about the presence of an unpaid order, in the text of this notification click "undo"and then repeat the order):
  4. If this is the first time ordering the service, skip this step to use free 7-day trial period... Otherwise, pay automatically generated invoice any of available ways and wait for the payment to be credited.
  5. Wait approximately 30 minutes for the service to activate.
  6. Configure Memcache (d) on the right sites.

Important points:

  • To use Memcache (d), the site settings must be set PHP version not lower than 5.2.
  • For business hosting, it should be borne in mind that if the maximum memory value is selected in the Memcache (d) settings, but part of the memory is consumed by other scripts, then the module will not be able to consume all the memory selected in the settings and will overwrite the oldest data in the cache. Therefore, when configuring, it is recommended to reserve part of the memory for the scripts.

To connect to the Memcache (d) server, you need to use the socket address specified in the section "Memcache statistics".

PHP modules are available to work with the service memcache and memcached, that is, you can connect to either one or the other socket:

If the site is running on one of the listed CMS, use the appropriate instructions to configure Memcache(d):

You can test the work of Memcache (d) with this script.

For detailed statistics on the use of Memcache (d) in the section "Hosting" in the block "Extra services" click "Memcache statistics":

Example statistics:

A brief description of each parameter can be found in official documentation (in English).

There are several ways to clear the Memcache (d) cache:

  • Through the control panel — use the button "Clear cache" in the upper right corner statistics.
  • Across Telegrambot — in the bot menu select "Hosting → Hosting account → your hosting account → Clear cache → Clear the Memcache cache".