Baru mendaftar? Silakan cek Mulai!
x
0 votes
asked by (230 points) 1

Kawan-kawan, saya lagi membangun website berita dengan menggunakan theme newspaper 8 dan barusan cek di gtmetrix, hasilnya kurang bagus meski loadnya cukup bagus.

Tolong bantuannya untuk optimasinya, setidaknya bisa 90 scorenya :)

2 Balasan

0 votes
answered by (4.3k points) 1 1 4
selected by
 
Best answer

Mempercepat wordpress harus dilakukan dari dua (2) sisi, yaitu optimasi scripts dan server.

Optimasi script wordpress

Meilihat dari hasil gtmetrixnya, bisa diptimasikan berikut:

Aktifkan leverage cache (cache pada browser)

Untuk mengaktifkan leverage cache, bisa tambahkan baris berikut di .htaccess

## 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 text/css "access plus 1 month"

ExpiresByType application/pdf "access plus 1 month"

ExpiresByType text/x-javascript "access plus 1 month"

ExpiresByType application/x-shockwave-flash "access plus 1 month"

ExpiresByType image/x-icon "access plus 1 year"

ExpiresDefault "access plus 2 days"

</IfModule>

## EXPIRES CACHING ##

Aktifkan kompresi gzip 

Untuk mengaktifkan kompresi gzip, bisa tambahkan baris berikut di .htaccess

<IfModule mod_deflate.c>

  # Compress HTML, CSS, JavaScript, Text, XML and fonts

  AddOutputFilterByType DEFLATE application/javascript

  AddOutputFilterByType DEFLATE application/rss+xml

  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject

  AddOutputFilterByType DEFLATE application/x-font

  AddOutputFilterByType DEFLATE application/x-font-opentype

  AddOutputFilterByType DEFLATE application/x-font-otf

  AddOutputFilterByType DEFLATE application/x-font-truetype

  AddOutputFilterByType DEFLATE application/x-font-ttf

  AddOutputFilterByType DEFLATE application/x-javascript

  AddOutputFilterByType DEFLATE application/xhtml+xml

  AddOutputFilterByType DEFLATE application/xml

  AddOutputFilterByType DEFLATE font/opentype

  AddOutputFilterByType DEFLATE font/otf

  AddOutputFilterByType DEFLATE font/ttf

  AddOutputFilterByType DEFLATE image/svg+xml

  AddOutputFilterByType DEFLATE image/x-icon

  AddOutputFilterByType DEFLATE text/css

  AddOutputFilterByType DEFLATE text/html

  AddOutputFilterByType DEFLATE text/javascript

  AddOutputFilterByType DEFLATE text/plain

  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)

  BrowserMatch ^Mozilla/4 gzip-only-text/html

  BrowserMatch ^Mozilla/4\.0[678] no-gzip

  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  Header append Vary User-Agent

</IfModule>

Minify css dan javascript

Untuk minfy css dan javascript bisa pakai plugin Autoptimize . Cukup instal dan aktifkan plugin itu tanpa konfigurasi apa2 :) 

https://id.wordpress.org/plugins/autoptimize/ 

Optimasi dari sisi server

Optimasi dari sisi server hanya bisa dilakukan kalau kita pakai VPS atau pakai layanan wordpress hosting seperti siteground atau hawkhost karena kedua layanan itu mensupport memcache atau redis di paket tertentu. 

JIka kita menggunakan VPS, panduan tweak server dan menambahkan memcached di wordpress bisa dilihat selengkapnya di https://www.idsysadmin.com/cara-mempercepat-loading-page-wordpress.html

Tapi kalau sudah pakai layanan hosting yang ada memcached atau redis, bisa langsung aktifkan dari layanan hosting dan setting memcached atau redisnya dengan bantuan plugin W3 Total Cache

commented by (230 points) 1
Mantabs. Terimakasih penjelasannya suhu.

Kalau sekarang masih pakai share hosting, apa nanti bs diupgrade ke vps ya?
+1 vote
answered by (380 points)
Aktifkan gzip dan instal plugin automize. Setekah itu, cb cek lagi di gtmetrix
Selamat Datang di Forum Tanya Jawab WordPress! Share permasalahan website WordPress Anda dan member komunitas membantu.

Related questions

0 votes
1 answer
asked Jun 18 by Mai (620 points) 1
0 votes
3 answers
asked Jun 16 by Mai (620 points) 1
0 votes
2 answers
0 votes
2 answers
asked Jul 25 by Agit (870 points) 2
0 votes
1 answer
...