Tối ưu font chữ trên web khi khi test PageSpeed

Chia sẻ từ các chuyên gia:

A inline đoạn CSS này vào <head>, qua lý thuyết + thử nghiệm thì nó cho kết quả tốt nhất:

<style>
@font-face {
font-family: "Roboto Slab";
font-weight: 700;
font-display: swap;
src:
local("Roboto Slab"),
url(/wp-content/themes/rooster/fonts/roboto-slab.woff2) format('woff2');
}
</style>

Em cũng cho rằng việc inline CSS là hiệu quả nhất khi tải font. Nhúng trong thẻ HEAD <style></style>. Hồi xưa đọc được vụ này bên 1 theme nào đó và áp dụng, kết quả là chính xác 100%

Nguyễn Minh Khôi

Leave a Reply

Your email address will not be published. Required fields are marked *