Disclosure: Some of the links in this website are “affiliate links.” This means if you click on the link and purchase the item, we will receive an affiliate commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.
Hawk Host is a highly recommened shared host for WordPress. Compared to other hosting providers, Hawk Host equips its hosting plans with many attractive features. Some key features:
- Use LiteSpeed server instead of Apache Server to gain the best speed
- Be quick to integerate the latest PHP version into cPanel
- Offer free Memcached support on all hosting plans
These features above really boost your website performance. Best of all, web hosting of Hawk Host is pretty affordable. Refer to my Hawk Host promo codes to get 40% off coupon.
When it comes to Memcached, Hawk Host integrate Memcached into its cPanel. By default, Memcached isn’t enabled. You will learn how to enable Memcached in this article. Also, I show you how to use Memcached on PHP 7.x.
What is Memcached?
Memcached is a distributed memory object caching system. It speeds up your website by caching data and object in RAM. Instead of querying the database directly, Memcached will cache common database queries and serve them from the cache.
As a result, the number of database queries is reduced. In other words, Memcached alleviates database loads. You can view the following diagram to understand how Memcached works.
To connect to Memcached server, PHP gives you two modules: Memcache and Memcached. PHP 7 removed Memcache module. Therefore, you can’t use Memcached Object Cache plugin if your website is running on PHP 7.x. I reveal another plugin to connect your website to Memcached server of Hawk Host.
How to use Memcached for PHP 7.x
1. First, you log in to cPanel of Hawk Host. Navigate to Hawk Host Links section. And click on Memcached link.
2. Click on Start Memcached link
3. If you start Memcached successfully, you will view the notice like this:
At present, Hawk Host uses Unix socket instead of TCP socket to connect to Memcached server. It is due to that Unix socket is 33% faster than TCP socket.
You will use the address of Unix socket to connect to Memcached server as shown below.
4. Back to cPanel Dashboard, navigate to Software. Click on Select PHP version link.
5. Find and select Memcached module
Go to WordPress admin. Install and activate MemcacheD is your friend plugin
As I mentioned above, PHP 7.x removed Memcache module. Thus, MecacheD is your friend is the most simple way to connect your website to the Memcached server.
After installing the plugin, you need to copy and paste the following code at the top of wp-config. Php
$memcached_servers = array( 'default' => array( '/home/lookwpco/.hostdata/memcached.sock:0') );
Remember to replace ‘/home/lookwpco/.hostdata/memcached.sock’ with your value.
Ultimately, go to Tools->Memcached. If everything is Ok, you will view statistics of Memcached.
That’s it. As such, you have already learned how to use the Memcached feature on the web hosting of Hawk Host. Now check the speed of your website again.
If you have trouble enabling Memcached, don’t hesitate to leave a comment below.
If you find my article helpful, don’t forget to share with your friends.