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

# Speed optimization

Part of the doc set: [Tân Doanh](https://phatdev.net/en/docs/tandoanh-theme.md)

> The PageSpeed techniques built into the Tốc độ (Speed) tab.

## Principle
Optimize for PageSpeed Insights on mobile first, and measure again after every change.

## Techniques in use
- **Critical CSS** per template, inlined in the `<head>`; the remaining CSS loads asynchronously on mobile.
- **Deferred third-party scripts** (Google Analytics, GTM, Facebook, Clarity) until the visitor interacts or 12 seconds have passed, which reduces Total Blocking Time.
- **PurgeCSS** on the theme and plugin source files, removing WooCommerce CSS on pages that do not need it.
- **Viewport-based section loading**: homepage product sections render only the first few cards, and the rest load as the visitor scrolls to them.
- **Images**: square sizes of 100 / 300 / 450 / 600, and `td-responsive` from 320 to 1200 for srcset.
- Preconnect, font preload, and removal of the `?ver` parameter from assets.

## Measurements
Google PageSpeed on 12 Jul 2026: mobile 91, desktop 97. The pre-built PC landing pages reach Lighthouse mobile 98 to 100.
