<p>Redis merupakan singkatan dari REmote DIctionary Server. Redis memiliki struktur key dan value dengan berbagai macam tipe data. Seperti Strings, Lists, Sets, Hashes, Sorted Sets dan Bitmaps. Redis memiliki kelebihan dapat diakses dengan Cepat, karena datasetnya tersimpan pada memory. Meskipun disimpan didalam memory, data tidak akan hilang, karena redis memiliki kemampuan persistence, artinya redis memiliki opsi untuk menjaga data agar tidak hilang.</p>
<p>Untuk tutorial ini, Redis akan dikonfigurasikan sebagai cache pada WordPress untuk mengurangi permintaan database yang berlebihan dan memakan waktu yang digunakan untuk memuat halaman WordPress. Hasilnya nanti yaitu situs WordPress akan lebih cepat diakses, menggunakan lebih sedikit sumber daya, dan menyediakan cache persisten yang dapat ditata.</p>
<p>Berikut langkah-langkahnya :</p>
<p>1. Pastikan WordPress sudah terinstal dengan baik pada server</p>
<p>2. Install paket redis-servernya</p>
<pre>apt update &;&; apt install redis-server php-redis -y</pre>
<p>3. Selanjutnya edit file wp-config.php yang ada pada home directory website WordPress anda, tambahkan baris berikut di paling bawah pada section &#8220;<span class="s1"><strong>Authentication Unique Keys and Salts</strong>&#8220;</span></p>
<pre>define( 'WP_CACHE_KEY_SALT', 'alamat_website_anda' ); 
define( 'WP_CACHE', true ); 
</pre>
<p>Jika sudah, save file tersebut</p>
<p>4. Kemudian silakan akses halaman wp-admin website anda, lalu install plugin bernama <strong>Redis Object Cache</strong></p>
<p><a href="https://rizkypratama.id/wp-content/uploads/2019/05/add-plugin-redis.png"><img data-attachment-id="1325" data-permalink="https://rizkypratama.id/blog/2019/05/09/konfigurasi-redis-wordpress-ubuntu/add-plugin-redis/" data-orig-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/add-plugin-redis.png?fit=1258%2C505&;ssl=1" data-orig-size="1258,505" data-comments-opened="1" data-image-meta="{";aperture";:";0";,";credit";:";";,";camera";:";";,";caption";:";";,";created_timestamp";:";0";,";copyright";:";";,";focal_length";:";0";,";iso";:";0";,";shutter_speed";:";0";,";title";:";";,";orientation";:";0";}" data-image-title="add-plugin-redis" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/add-plugin-redis.png?fit=300%2C120&;ssl=1" data-large-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/add-plugin-redis.png?fit=810%2C325&;ssl=1" class="aligncenter wp-image-1325 size-full" src="https://rizkypratama.id/wp-content/uploads/2019/05/add-plugin-redis.png" alt="" width="1258" height="505" /></a></p>
<p>5. Selanjutnya cek pada menu <strong>Settings | Redis</strong></p>
<p><a href="https://rizkypratama.id/wp-content/uploads/2019/05/setting-redis.png"><img data-attachment-id="1326" data-permalink="https://rizkypratama.id/blog/2019/05/09/konfigurasi-redis-wordpress-ubuntu/setting-redis/" data-orig-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/setting-redis.png?fit=164%2C405&;ssl=1" data-orig-size="164,405" data-comments-opened="1" data-image-meta="{";aperture";:";0";,";credit";:";";,";camera";:";";,";caption";:";";,";created_timestamp";:";0";,";copyright";:";";,";focal_length";:";0";,";iso";:";0";,";shutter_speed";:";0";,";title";:";";,";orientation";:";0";}" data-image-title="setting-redis" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/setting-redis.png?fit=121%2C300&;ssl=1" data-large-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/setting-redis.png?fit=164%2C405&;ssl=1" class="alignnone wp-image-1326 size-full" src="https://rizkypratama.id/wp-content/uploads/2019/05/setting-redis.png" alt="" width="164" height="405" /></a></p>
<p>6. Pada menu <strong>Redis</strong> tersebut, pastikan statusnya sudah connected seperti berikut ini.</p>
<p><a href="https://rizkypratama.id/wp-content/uploads/2019/05/status-redis.png"><img data-attachment-id="1328" data-permalink="https://rizkypratama.id/blog/2019/05/09/konfigurasi-redis-wordpress-ubuntu/status-redis/" data-orig-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/status-redis.png?fit=1259%2C430&;ssl=1" data-orig-size="1259,430" data-comments-opened="1" data-image-meta="{";aperture";:";0";,";credit";:";";,";camera";:";";,";caption";:";";,";created_timestamp";:";0";,";copyright";:";";,";focal_length";:";0";,";iso";:";0";,";shutter_speed";:";0";,";title";:";";,";orientation";:";0";}" data-image-title="status-redis" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/status-redis.png?fit=300%2C102&;ssl=1" data-large-file="https://i0.wp.com/rizkypratama.id/wp-content/uploads/2019/05/status-redis.png?fit=810%2C277&;ssl=1" class="aligncenter wp-image-1328 size-full" src="https://rizkypratama.id/wp-content/uploads/2019/05/status-redis.png" alt="" width="1259" height="430" /></a></p>
<p>7. Silakan akses website WordPress anda, lalu cek juga menggunakan perintah <strong><em>redis-cli monitor</em></strong>, pastikan terdapat log aktivitas berikut ini.</p>
<pre>root@nginx:~# redis-cli monitor 
OK 
1557420062.009756 [0 127.0.0.1:46004] "PING" 
1557420062.013122 [0 127.0.0.1:46004] "GET" "rizkypratamawp_:default:is_blog_installed" 
1557420062.014515 [0 127.0.0.1:46006] "PING" 
1557420062.015826 [0 127.0.0.1:46006] "GET" "rizkypratamawp_:default:is_blog_installed" 
1557420062.037397 [0 127.0.0.1:46006] "GET" "rizkypratamawp_:options:notoptions" 
1557420062.038813 [0 127.0.0.1:46006] "GET" "rizkypratamawp_:options:alloptions" 
1557420062.039766 [0 127.0.0.1:46006] "GET" "rizkypratamawp_:site-options:1:notoptions" 
1557420062.040116 [0 127.0.0.1:46004] "GET" "rizkypratamawp_:options:notoptions" 
1557420062.040359 [0 127.0.0.1:46004] "GET" "rizkypratamawp_:options:alloptions" 
1557420062.043117 [0 127.0.0.1:46004] "GET" "rizkypratamawp_:site-options:1:notoptions" 
</pre>
<p>Jika sudah terdapat log tersebut, maka konfigurasi Redis Cache pada WordPress sudah berhasil dilakukan, cukup mudah bukan</p>
<p>Mungkin cukup sekian, semoga bermanfaat</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img src="https://rizkypratama.id/wp-content/uploads/2020/09/My-Photos.jpg" width="100" height="100" alt="My Photos" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://rizkypratama.id/blog/author/rizky/" class="vcard author" rel="author"><span class="fn">Rizky Pratama</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Rizky Pratama. Tinggal di Bekasi, Jawa Barat. Seorang IT di salah satu perusahaan IT. Pengguna Mac, Linux dan Windows<br />
Selain sebagai penulis di blog ini, saya juga penulis di blog saya yang lain, yaitu <a href="https://pratama.biz.id" target="_blank" rel="noopener noreferrer">https://pratama.biz.id</a></p>
</div></div><div class="saboxplugin-web "><a href="https://rizkypratama.id" target="_blank" >rizkypratama.id</a></div><div class="clearfix"></div><div class="saboxplugin-socials sabox-colored"><a title="Facebook" target="_blank" href="https://web.facebook.com/rizkypratama04" rel="nofollow noopener" class="saboxplugin-icon-color"><svg class="sab-facebook" viewBox="0 0 500 500.7" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path class="st0" d="m499.4 250.9c0 9.9-0.6 19.7-1.7 29.2-0.1 0.6-0.1 1.1-0.2 1.7-0.8 6.3-1.8 12.4-3 18.5-0.2 1.1-0.5 2.2-0.7 3.3-1.2 5.6-2.6 11-4.2 16.5-23.4 81.3-87.1 145.6-168.2 169.8-4.5 1.3-9.1 2.6-13.7 3.7-7.6 1.8-15.4 3.3-23.3 4.4-5.5 0.8-11.1 1.3-16.7 1.7-0.8 0.1-1.6 0.1-2.4 0.1-5 0.3-10.1 0.4-15.2 0.4-137.8 0-249.4-111.6-249.4-249.3s111.6-249.4 249.4-249.4 249.3 111.7 249.3 249.4z" fill="#3b5998" /><path class="st1" d="m493.8 303.6c-1.2 5.6-2.6 11-4.2 16.5-23.4 81.3-87.1 145.6-168.2 169.8-4.5 1.3-9.1 2.6-13.7 3.7l-100.9-101 1.8-3.5 2.1-76.7-45.3-43.7 41.3-31 30-95.3 71.4-24.7 185.7 185.9z" /><path class="st2" d="M206.8,392.6V268.8h-41.5v-49.2h41.5v-38.8c0-42.1,25.7-65,63.3-65c18,0,33.5,1.4,38,1.9v44H282 c-20.4,0-24.4,9.7-24.4,24v33.9h46.1l-6.3,49.2h-39.8v123.8" /></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/rzkyprtmaaa01/" rel="nofollow noopener" class="saboxplugin-icon-color"><svg class="sab-instagram" viewBox="0 0 500 500.7" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path class="st0" d="m499.8 250.7c0 7.6-0.4 15.2-1 22.6-0.2 2.2-0.4 4.4-0.7 6.6-0.1 0.6-0.1 1.1-0.2 1.7-0.3 2.6-0.7 5.2-1.1 7.7-0.4 2.3-0.8 4.7-1.2 7 0 0.3-0.1 0.6-0.2 0.9-0.2 1-0.4 1.9-0.5 2.9-0.2 0.8-0.4 1.6-0.5 2.5-0.1 0.3-0.1 0.5-0.2 0.8-0.7 3.3-1.5 6.5-2.3 9.7-0.6 2.3-1.2 4.5-1.9 6.8-23.4 81.3-87.1 145.6-168.2 169.8-3 0.9-6.1 1.8-9.2 2.6-1.5 0.4-3 0.8-4.5 1.1-3.6 0.9-7.2 1.6-10.9 2.3-0.2 0-0.5 0.1-0.7 0.1l-3 0.6c-1.8 0.3-3.6 0.6-5.4 0.9-0.2 0-0.3 0.1-0.5 0.1-0.9 0.1-1.9 0.3-2.8 0.4-5.5 0.8-11.1 1.3-16.7 1.7-0.8 0.1-1.6 0.1-2.4 0.1-5 0.3-10.1 0.4-15.2 0.4-137.7 0-249.3-111.6-249.3-249.3s111.6-249.4 249.3-249.4 249.3 111.7 249.3 249.4z" fill="#405de6" /><path class="st1" d="m495.4 297.2c-0.2 1-0.4 1.9-0.5 2.9-0.2 0.8-0.4 1.6-0.5 2.5-0.1 0.3-0.1 0.5-0.2 0.8-0.7 3.3-1.5 6.5-2.3 9.7-0.6 2.3-1.2 4.5-1.9 6.8-23.4 81.3-87.1 145.6-168.2 169.8-3 0.9-6.1 1.8-9.2 2.6-1.5 0.4-3 0.8-4.5 1.1-3.6 0.9-7.2 1.6-10.9 2.3-0.2 0-0.5 0.1-0.7 0.1l-151.5-152.7v-147l9.2-27 14.8-14 33-8 70-5 80.5 11.7 142.9 143.4z" /><path class="st2" d="m252.7 192.1c-34.1 0-61.6 27.5-61.6 61.6s27.5 61.6 61.6 61.6 61.6-27.5 61.6-61.6-27.5-61.6-61.6-61.6zm0 101.6c-22 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm78.5-104.1c0 8-6.4 14.4-14.4 14.4s-14.4-6.4-14.4-14.4 6.4-14.4 14.4-14.4c7.9 0 14.4 6.4 14.4 14.4zm40.7 14.6c-0.9-19.2-5.3-36.3-19.4-50.3-14-14-31.1-18.4-50.3-19.4-19.8-1.1-79.2-1.1-99.1 0-19.2 0.9-36.2 5.3-50.3 19.3s-18.4 31.1-19.4 50.3c-1.1 19.8-1.1 79.2 0 99.1 0.9 19.2 5.3 36.3 19.4 50.3s31.1 18.4 50.3 19.4c19.8 1.1 79.2 1.1 99.1 0 19.2-0.9 36.3-5.3 50.3-19.4 14-14 18.4-31.1 19.4-50.3 1.2-19.9 1.2-79.2 0-99zm-25.6 120.2c-4.2 10.5-12.3 18.6-22.8 22.8-15.8 6.3-53.3 4.8-70.8 4.8s-55 1.4-70.8-4.8c-10.5-4.2-18.6-12.3-22.8-22.8-6.3-15.8-4.8-53.3-4.8-70.8s-1.4-55 4.8-70.8c4.2-10.5 12.3-18.6 22.8-22.8 15.8-6.3 53.3-4.8 70.8-4.8s55-1.4 70.8 4.8c10.5 4.2 18.6 12.3 22.8 22.8 6.3 15.8 4.8 53.3 4.8 70.8s1.5 55.1-4.8 70.8z" /></svg></span></a><a title="User email" target="_self" href="mailto:rizk&#121;&#064;&#114;iz&#107;&#121;pr&#097;t&#097;&#109;&#097;&#046;id" rel="nofollow noopener" class="sabox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.2 0.1-0.3 0.1 -0.4 0.1-0.7 0.2-1.1 0.3 -1 0.3-2.1 0.6-3.1 0.8 -1 0.3-2 0.5-3.1 0.6 -0.1 0-0.2 0-0.3 0.1 -1 0.2-1.9 0.4-2.9 0.7 -0.3 0.1-0.7 0.2-1 0.2 -0.2 0.1-0.5 0.1-0.7 0.2 -1.5 0.3-2.9 0.5-4.3 0.8 -0.6 0.1-1.3 0.2-1.9 0.4 -0.2 0-0.3 0.1-0.5 0.1 -1.1 0.2-2.2 0.4-3.3 0.6 -1.2 0.2-2.4 0.4-3.5 0.5 -0.7 0.1-1.4 0.2-2.1 0.3 -0.3 0-0.5 0.1-0.8 0.1 -2.7 0.4-5.5 0.7-8.2 1 -0.3 0-0.7 0.1-1 0.1L119.9 344.1l105.3-46.7L119.9 191.6l265.6-41.2L499.1 263.2z" /><path class="st2" d="M390.1 214.1c2.1-1.7 5.3-0.1 5.3 2.6v112c0 14.5-11.8 26.3-26.3 26.3H141.2c-14.5 0-26.3-11.8-26.3-26.3v-112c0-2.7 3.1-4.3 5.3-2.6 12.3 9.5 28.5 21.6 84.4 62.2 11.6 8.4 31.1 26.2 50.5 26.1 19.6 0.2 39.4-18 50.6-26.1C361.6 235.7 377.8 223.6 390.1 214.1zM255.1 284.8c12.7 0.2 31-16 40.2-22.7 72.7-52.8 78.2-57.4 95-70.5 3.2-2.5 5-6.3 5-10.4v-10.4c0-14.5-11.8-26.3-26.3-26.3H141.2c-14.5 0-26.3 11.8-26.3 26.3v10.4c0 4.1 1.9 7.8 5 10.4 16.8 13.1 22.3 17.7 95 70.5C224.1 268.8 242.4 285 255.1 284.8L255.1 284.8z" /></svg></span></a></div></div></div>
Beberapa hari yang lalu saat saya sedang scroll timeline X (Twitter) saya menemukan sebuah postingan…
Beberapa waktu lalu saya ada migrasi dan upgrade beberapa server, salah satunya server postfix. Server…
Pada bulan April 2024 lalu, Ubuntu telah release versi terbaru yaitu Ubuntu 24.04 LTS, sehingga…
Ngga nyangka akhirnya saya bisa login kembali ke blog saya yang sudah berdebu ini, kali…
Beberapa waktu lalu, Excellent mendapatkan project migrasi Zimbra dari versi Open Source Ke Zimbra Network…
Bulan Oktober 2022 lalu, Apple resmi release MacOS terbaru mereka, yaitu MacOS Ventura. Beberapa fitur…