CASE← DuanYuan中文

Rebuilding a content site: article store and full-text search

15-year-old site · GBK + encrypted core · new engine, same content

Problem

A CMS site that had been running for fifteen years: GBK encoding, parts of the codebase shipped as encrypted Zend files, templates welded to the data layer. It had to move servers, gain a mobile layout, and keep its search rankings.

Approach

Read-only backup of site and database, table by table row counts compared. Articles, categories, a 1,748-row people table and attachments were loaded into SQLite. The template layer was rewritten in plain PHP while keeping every URL shape, and old links were 301'd one by one.

Details

Search moved from a LIKE full scan to an FTS5 virtual table kept in sync by triggers, with Chinese text split per character and matched by prefix. List pages switched to cursor pagination so deep pages stay cheap.

Search 56 ms to 0.29 ms; home page steady around 0.1 s; zero dead links after a page-by-page re-check.

Open the demo →

Download source ↓ (free with an account)

RELATED
← All cases
DuanYuan · Notes & Experiments
冀ICP备2026047080号-1·冀公网安备13020702000398号
Join free · Contact