Ikuti cara Setting dan masukan kode Browser Laverage Caching pada .htaccess Untuk Tingkatkan Speed WordPress. Ini adalah trick WordPress tanpa menggunakan plugins atau sebagai pelengkap plugins.
Langkah-langkah Cara Setting Browser Laverage Caching Untuk Tingkatkan Speed WordPress
Sebelum menjalankan ini, sebaiknya anda cek terlebih dahulu tipe atau file apa yang perlu diberikan konfigurasi caching.
Terbagi beberapa tipe file file yaitu:
- Image
- Script
- Video
- Font
IMAGE
Yang termasuk kedalam image misalnya file dengan extensi: jpg, jpeg, gif, png dst
SCRIPT
Yang termasuk kedalam script misalnya file dengan extensi: js. css dst
VIDEO
Yang termasuk kedalam tipe Video misalnya file dengan extensi: mp4, mov dst
FONT
Yang termasuk kedalam tipe font misalnya file dengan extensi: woff, woff2, ttf dst
Jadi kesimpulannya adalah anda harus menyesuaikan tipe file apa saja yang butuh diberikan konfigurasi browser laverage caching.
Fungsi Mengkonfigurasi Browser Laverage Caching
Fungsi Mengkonfigurasi Browser Laverage Caching Adalah meningkatkan kecepatan website anda berdasarkan Google Web Vital Core yang dilakukan dengan cara mengkonfigurasi website dan server.
1. Copy kode dibawah ini:
## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/svg "access plus 1 year" ExpiresByType text/css "access plus 1 year" ExpiresByType text/x-javascript "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 1 year" </IfModule> ## EXPIRES CACHING ## # Fonts # Add correct content-type for fonts AddType application/vnd.ms-fontobject .eot AddType application/x-font-ttf .ttf AddType application/x-font-opentype .otf AddType application/x-font-woff .woff AddType application/font-woff2 .woff2 # Compress compressible fonts # only uncomment if you dont have compression turned on already. Otherwise it will cause all other filestypes not to get compressed # AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-opentype image/svg+xml ExpiresActive on # Add a far future Expires header for fonts ExpiresByType application/vnd.ms-fontobject "access plus 1 year" ExpiresByType application/x-font-ttf "access plus 1 year" ExpiresByType application/x-font-opentype "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/font-woff2 "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 year"
2. Login ke cpanel hosting
3. Visit File Manager
4. Buka .htaccess file
5. Paste kode diatas pada bagian bawah file .htaccess
6. Klik save
Hasil Setting Sebelum dan Sesudah di Test Menggunakan Google Page Speed
SEBELUM

SESUDAH
