When I talk to people I know and tell them that I develop static websites, I usually get one of two reactions: they either look at me blankly or like I’ve lost my mind. Static sites have somewhat of a bad stigma from the old days of the Internet where all websites were static in the sense that they had static layouts, did not load well on many browsers, and overall offered a lousy user experience. Today, static websites can provide many of the same benefits as dynamic websites without many of their drawbacks.
The benefits of developing a static website are speed, security and cost all while running on a smaller footprint, offering version control and being highly scalable. While there are some caveats to these features - especially regarding the speed of websites - these features can be used as a general rule when discussing static websites. It’s hard to have a discussion on static websites without comparing them to dynamic sites - especially given the prevalence of dynamic sites - I’ll try to constrain my focus to the benefits that you leverage by developing websites using a static methodology.
I’ll plan on writing a full comparison on the differences between static and dynamic websites, but for now, I need to provide a basic definition for what they are so you’re clear on what I mean when I say static or dynamic websites. Static websites are developed using static resources, but they aren’t necessarily displayed statically on the screen. On the other hand, dynamic sites create their content dynamically by pulling content from a repository, usually a database.
In my experience, this is the most commonly discussed benefit of using static websites. Static websites are able to merely serve files from a repository without having to do any processing on the backend to generate the content, making them faster than their dynamic counterparts. Dynamic websites have to query to pull the data they need to display, which almost always adds to the amount of time required to show the page.
Now, when I talk about speed, I’m talking about page load time, specifically about the amount of time for the content visible on your user’s browser to be fully rendered. The amount of time your site takes to load is significant. A document prepared by iCrossing iCrossing discusses many studies that were conducted by various companies into how page load speed affects their business. Independent studies by Google, Facebook, Bing, and Amazon - as well as others - found that page load time significantly impacted user retention and conversion rates, especially for mobile users.
Google found that page load speed is important enough that it uses page speed as a factor in its index rankings. Developing your site using a static methodology can help your page load faster as it eliminates the backend processing that is done on dynamic websites. Your business may not be as big as Google or Amazon, but if you can help position your site to be faster than your competitors without sacrificing usability, it seems like an excellent step to take.
Finally, because static files are what is sent to your users, rendering the same page every time it is requested is redundant. Instead of creating the page each time, using a static page, you build the page once, and the same page is delivered each time, which will allow your users to load pages faster. If the page isn’t going to change - at least not often - it’s useful to use static pages.
The caveat for speed
Dynamic sites are getting faster these days by using a technique called caching. These systems store commonly accessed versions of your website on nodes close to your users allowing users to access your site more quickly.
Caching is basically allowing a system - although sometimes you can specify this manually - to choose which pages on your site to create a static version. This is functionally similar to using a static website without any of the other benefits of static websites.
Static websites boast better security than their dynamic counterparts. With static sites, you can host your files on file hosts - such as Amazon S3 - or a content delivery network (CDN) instead of hosting a managed, server-based environment. Just by hosting your site in such a fashion, you will be more secure, but you also eliminate other parts of the software that can make your site less secure.
Many websites elect to use WordPress to host their sites. These are used to host dynamic sites, but the software has to be kept up to date. This means that whenever they update their software, and you don’t update your hosting environment quickly, your site may be exposed to a security vulnerability. WP White Security states that as many as 70% of WordPress installations are subject to security vulnerabilities.
You may be thinking that your site is safe because you host your WordPress site with a paid hosting and they always keep their software up to date, right? However, that isn’t always true as some hosts allow you to select which version of WordPress you’re running and won’t automatically update your site to the latest version. Even if they did, any plugins you use would have to be updated manually, presenting another potential for security risk.
Unfortunately, other CMS solutions aren’t in a better situation.
Static sites are almost always less expensive to host than their dynamic counterparts. With static websites, you have a more streamlined hosting solution that has fewer components, which inevitably leads to lower costs.
With dynamic hosting, you have to pay for the server - even if it’s on a shared one - database, backup and transactions. Also if you go with a hosted solution all of these components are usually factored into the cost, which costs more.
Static websites usually only have to pay for the file hosting. You may have to pay for bandwidth - data sent or received - but that cost can be minimized with intelligent design to reduce your file sizes. In fact, if you can get your pages small enough, it’s possible to handle up to 100k page views before you’ve surpassed the limits of the free tier.
I’ve alluded to this one several times, and that’s fewer components that you need to pay for and/or maintain. Static websites only have the file hosting that you have to work within your production environment, which makes your day-to-day operations easier and more smooth.
Dynamic sites have many components that you have to set up, maintain, and plan for upgrading if you need to scale your website. Some of this can be abstracted through the use of a hosted solution, but that doesn’t eliminate the footprint, it merely hides it under a sheet.
As a benefit of a smaller footprint, static websites are easier to scale. Don’t listen to critics that say that you can’t scale a static website as easily as a dynamic one. Sure, you have to plan for how you’ll develop your site to make it easier to grow, but that’s something you should do for any site you build.
Scalability can focus on two different aspects of a website: the amount of traffic you get from your users and the amount of content on your site.
Scaling for traffic
Since you have a small footprint for your static site, there is only one thing that your website needs to handle: bandwidth. Bandwidth is usually allocated by your web host, and you may need to pay for more bandwidth to allow your site to be served to more users.
Even simpler than that, many hosts - such as AWS and Google Firebase - only charge you for the amount of bandwidth that you use. In this case, you don’t have to do anything to scale your site, you’ll just pay for what you use.
Scaling for content
The big draw for dynamic sites is that it is generally easy to add new content, especially if you’re using a CMS like WordPress. Adding more content usually involves a few clicks - maybe some writing if you’re publishing an article - and you have new content. CMSs typically offer the ability to create accounts for other users, allowing you to delegate publishing new content to other users.
When you’re working with a static site, it can be more complicated to add more content if your site isn’t designed intelligently. If you design your website correctly, you can easily publish new content. Developing in a dynamic environment and using a static site generator you can quickly put new content on your site, convert it to static pages and upload the latest files.
When you’re working with static websites, you can implement version control measures for your site. Since you have static points in time for when you publish your website, there are definite demarcation points between each iteration. If you implement a version control system - such as GIT - you can implement version control for your files.
What is a CMS? - A CMS is a content management system that stores your content in a database. A CMS usually stores the content in a database and uses scripts to generate pages dynamically when requested.
What is a static website generator? - A static website generator is a tool that will convert a dynamic website into a static one. This can help ease the development of a static site and make it easy to publish new versions of your site without having to use copy-paste.
Static websites offer quite a bit of benefit over dynamic ones. A static website generator eliminates the main drawback of developing your site with a static methodology.
Do you have anything to add to the conversation? Perhaps you know of some features I missed? Do you think that dynamic websites are better in every way? I’d love to hear from you in the comments below.
If you want to learn more about static websites, stay tuned for further articles. If you’re interested in learning when I’ll be putting up new content, I’ll be creating a mailing list as soon as its feasible.
Thank you for reading, and I’ll see you in the next article.