Static content is any content that can be delivered to an end user without having to be generated, modified, or processed. The server delivers the same file to each user, making static content one of the simplest and most efficient content types to transmit over the Internet.
Most modern websites are always changing. Websites frequently adapt their layout, content, and available features based on who accesses it. In many cases, a website will deliver entirely different content to one user than another user, even if their requests are less than a second apart. This content is known as dynamic content, since it can change on a per-request basis.
Static content, on the other hand, rarely changes. It doesn’t depend on user input or preferences. While static content is less interactive than dynamic content, it’s generally faster to cache, process, and deliver.
Fetching a static asset from a server is one of the basic functions of the web. For example, typing the following URL in a web browser (http://www.example.com/index.html) fetches the file index.html from the server hosting example.com.
There are three steps to requesting static content from a server:
This section isn’t meant to promote static over dynamic content. Almost every website uses a mix of content types to provide a balance between speed and interactivity. However, there are some clear benefits to hosting static content:
While static websites drove the initial growth of the web, most of today’s websites are dynamic, user-driven applications. Although the days of the early web are over, some web services are working to merge the performance gains of static websites with the usability of modern web platforms.
StaticGen provides a leaderboard of website generators that build static websites from dynamic content. Meanwhile, platforms like WordPress support static content generation through plugins like the WP Super Cache plugin. It’s unlikely we’ll revert to static web pages, but we can take advantage of the speed and simplicity of static content to boost the modern web.