Who this is for. Whoever has to say yes or no to headless in a meeting. After this page you can name the cases where it is right and answer the three arguments for it that are not, with the platform's facts rather than taste.
When headless is right
- The interface is an application. State persists across screens, the user works in it for long stretches, and a page load between steps would break the work: a configurator, a dashboard, a planning tool.
- The front end must also be a native app's. One front end has to serve an app that cannot use HTML.
Both are requirements of the product. Even then, check whether the whole site needs to follow. A native app can read the API while the marketing site stays server-rendered, and an application-like area can be one island inside a server-rendered site, as the single-page checkout in the case studies is.
Wrong reason 1: the team already knows a JavaScript framework
That is an argument for islands of that framework in a hybrid site, which keep routing, the page cache, preview and in-context editing (Hybrid, the common case). The framework runs where interaction is; the platform keeps composing pages. The team learns one template language for the page shells, and Smarty and Twig are both small to learn for that purpose.
Wrong reason 2: the word was in the brief
Ask what problem the word was meant to solve. It is usually one of three: content that must reach more than one channel, which the API serves while the website stays server-rendered; a modern, interactive front end, which islands give; or speed, which is the next reason. Occasionally it is one of the two real requirements above, and then the decision is easy.
Wrong reason 3: it will be faster
A cached page on Core dna is sent before any template runs and before the platform has checked who is asking (Where the platform hands off a request). A stored page lasts a day by default, and in the default Smart cache clear mode, saving a record clears only the pages that showed it, so the cache stays warm while content changes. Where the site turns on CDN caching for pages, the copy is served from the CDN as well. A headless front end has to match that, not beat a slow baseline. When a page is slow on the platform, the cause is usually a template that runs a query per item in a loop, or a page that cannot be cached, and both are fixed in the template (Find out why a page is slow).