Single-Page Application (SPA)

Rendering a page from scratch takes a lot of effort from the browser. It must load the HTML markup, the CSS, and any JavaScript, render and style the markup, and attach scripts to events and models. Liferay DXP’s Single-Page Applications (SPA) feature avoids this performance cost by retrieving multiple paths from the web server that change the currently loaded page instead of loading a new page every time.

When you enable SPA in your instance, Liferay uses a template to organize the content on your site so that user navigation reloads the necessary content seamlessly, without reloading the whole page. The URL updates dynamically to reflect the new state of the page, so you can navigate back to the same page state again easily.

Enabling and Configuring SPA

Enable single-page applications from the Instance Settings (or System Settings), under InfrastructureFrontend SPA Infrastructure.

Enable or disable SPA under Instance Settings or System Settings.

The SPA configuration in Instance Settings overrides the configuration in System Settings for your instance, so you can have more fine-tuned configurations for your specific Liferay instance.

Note

Before Liferay DXP 2025.Q4, enable or disable SPA with the portal property javascript.single.page.application.enabled. With 2025.Q4+, this property sets the default value for new instances.

On this page, you can also configure the behavior, including the SPA cache behavior, which CSS selectors or paths SPA should ignore, and whether to pre-load CSS resources before applying UI changes.