Statamic 5: What's New for Web Development?

“Today we will talk about Statamic 5, the new version of this powerful Laravel-based CMS.”

The new version of Statamic brings significant improvements in performance, developer experience, and modernization.

Let’s explore each of them!

Performance Improvements

Intelligent Caching and Better Resource Management

Statamic 5 introduces an intelligent caching system, which temporarily stores frequently used data or information, such as page structures (tree items) and URLs. This allows the website to access this data quickly without needing to recalculate it each time, resulting in much faster response times.

The resource management process has also been optimized, reducing memory usage and temporary cache storage. This means that the system frees up memory and storage space more efficiently, which is particularly beneficial for large static websites with a lot of content.

Optimized Flat-File Queries

A flat-file is essentially a text file (.yaml) where data is stored in lines, each representing a record. There is no need for database management software to read or write them. Statamic, by default, uses this type of file.

In Statamic 5, queries to these flat-files have been enhanced to allow for faster and more efficient searches. Instead of reading all files at once, the system now reads only the ones needed at the moment. This means searches are quicker because the system processes less data at a time. Additionally, the retrieval of Globals—which are settings or data used across the website (e.g., contact information)—has been improved to process information only when truly necessary, thus avoiding resource wastage.

Since Statamic uses this system and does not solely rely on a database (though it does allow for it), it is less vulnerable to security flaws. And as it is a lightweight CMS, it loads faster and performs better than other CMS options. This means that the website will be not only more secure but also more responsive and pleasant for its users.

Developer Experience

New Command-Line Commands

Statamic 5 introduces new command-line commands, making installation and configuration easier.

These commands use Laravel Prompts to guide developers through interactive questions, making the process more intuitive, quicker, and less prone to errors.

SQL Query Simulation

In this new version, it is possible to simulate SQL queries (consulting, adding, modifying, or deleting stored information) even when using flat-files instead of a traditional database.

Analysis tools like Debug Bar, Laravel Telescope, and Ray can display these simulated queries. This helps developers see how data would be accessed and manipulated in a database, facilitating performance analysis and problem identification. The tools display these queries, aiding in resolving performance issues more efficiently.

Multi-Site Management in the Control Panel

Non-technical users can add, edit, and remove sites without touching the code. This improves the ability to create and manage multiple independent websites using the same platform and control panel.

Testing Framework for Addons

When creating new addons (extensions that add functionality to the CMS), Statamic 5 automatically includes a set of PHPUnit tests (which check code functionality, including unit, integration, and functional tests), making the testing process easier and ensuring code quality. This allows for early error detection.

Modernization

Statamic 5 updates dependencies to the latest versions of Laravel (9 and 10) and removes support for outdated PHP and Laravel versions. This keeps the system up-to-date with modern standards.

At Webcomum, we are already testing Statamic 5! Discover the significant improvements in performance and usability it offers. Stay tuned for updates and follow us on LinkedIn for more news and exclusive insights from the web development field.