---
title: "Speed optimization toolkit"
url: https://phatdev.net/en/docs/hungphat-laptop/toi-uu-toc-do
lang: en
updated: 2026-10-20
alternate:
  vi: https://phatdev.net/docs/hungphat-laptop/toi-uu-toc-do
markdown: https://phatdev.net/en/docs/hungphat-laptop/toi-uu-toc-do.md
---

# Speed optimization toolkit

Part of the doc set: [Hưng Phát Laptop (Theme)](https://phatdev.net/en/docs/hungphat-laptop.md)

> Speed options: delayed third-party scripts, purged CSS, async CSS on mobile, font preloading and more for high PSI scores.

The theme ships with a speed toolkit that helps pages reach **high PageSpeed scores** while keeping every feature. It is configured under the **HP Theme** menu in the admin.

## Main optimizations (enabled by default)
- **Delaying third-party scripts** (GTM / Google Analytics / Ads / Facebook): loaded only on the visitor's **first interaction** (scroll/touch/mouse move) - greatly reducing initial load time while still keeping **ad conversion tracking**.
- **PurgeCSS-processed CSS**: only the CSS that is actually used is loaded (with a separate build for the shop page) → less render-blocking size.
- **Async CSS on mobile** (desktop stays blocking to avoid layout shift / CLS = 0).
- **Font preloading, CDN preconnect**, blocking of unnecessary thumbnail generation, caching of homepage blocks...

## Operating notes
- **Logged-in admins** bypass the page cache → the homepage and PDP loading slower than for anonymous visitors is normal.
- After changing the design or content, if you still see old CSS → **clear the cache** (WP Fastest Cache) and reload.

> Don't enable another optimization plugin on top (it easily conflicts with minify/critical CSS). The theme already handles this part.
