Who this is for. A lead planning a change of shape or engine on a site that is already live, or a team at kickoff weighing what changing course later would cost. After this page you can tell an incremental change from a rewrite, and size each in what has to change rather than in days.
The three paths at a glance
| Path | Kind of change | Data | What sets the size |
|---|---|---|---|
| Server-side to hybrid | Incremental: one page, one element at a time | No change | The number of per-visitor elements; one client module; one site-data switch per feature that can be turned off |
| Hybrid to headless | A rewrite: a second application | No change | Every row of the rebuild worksheet, for every kind of record with a URL |
| Smarty to Twig, or Twig to Smarty | A full template rewrite | No change | Every template file, plus the template code stored in jobs, discount conditions and shipping methods |
None of the three touches content. Layouts, layout areas, revisions, records, custom entities, jobs, members, forms and commerce behave the same in every shape (What the choice does not change). What differs is how much of the code is written again.
Server-side to hybrid: incremental and safe
Hybrid is server-side with additions. The mechanism is three pieces: a fragment template that switches caching off, a dispatcher that serves fragments by name, and a script that fetches them after the cached page has painted (Dynamic fragments). Adding the first fragment changes nothing about a cached page that is already correct, so you convert one page at a time and release each step on its own.
The order to work in
- Move the three elements that always need a fragment: sign-in state, the cart count and personalised blocks (The three things that always need a fragment).
- Build the one client module that carries the CSRF token, once, for every script that writes to the platform (One client module, carrying the CSRF token).
- Where a feature should be switchable, gate its bundle with a site-data switch, so that it loads only when it is on (A personalisation bundle that loads only when it is on).
How big it is
Count the per-visitor elements on the site: each becomes its own fragment, with its own decision about what its cache varies by. Add one client module, built once, and one site-data switch for each feature that should be switchable. That count is the estimate. The cached pages around the fragments stay as they are.
Hybrid to headless: a rewrite, not a refactor
A hybrid site looks halfway to headless, because parts of it already talk to the API. It is not. The platform still composes every page of a hybrid site: routing, template resolution, the page cache, revisions and live preview, SEO output, the sitemap, error pages, forms and member sign-in are all built in (What the platform does that you do not write). A headless build gives up every one of them, and the front end rebuilds what it needs: a router for every record type with a URL, rewrites and redirects, 404 and error pages, SEO tags, the sitemap, caching and invalidation, and preview (What a headless build gives up).
Why the islands do not carry over
The hybrid site's client module is built for a page the platform rendered and a visitor's signed-in session on it. It sends the CSRF token only when someone is signed in, only with POST, PUT, PATCH and DELETE, and sends no Authorization header (One client module, carrying the CSRF token). A headless front end authenticates as an external application instead, with OAuth (the preferred credential) or an API key (the older option), as Authenticating an external application describes, and it composes the whole page itself. So the shell, the routing and the islands are rebuilt together, not adapted in place.
How big it is
Take every row of the worksheet on What a headless build must rebuild and multiply it by every kind of record the site has with a URL: pages, blog posts, book pages, product descriptions and custom entity records, each with its own route. That is the estimate. It is not a conversion of the existing templates: it is a second application, and it is planned, staffed and tested as one.