What is a static site
A static site put simply, is a website that has no database or 'dynamic' content being loaded into the page when a user visits the site. So, as an example, if you go to a typical blog that is powered by Wordpress (a hugely popular content management system) behind the scenes Wordpress queries a database to retrieve the content of the blog article (title, content & images) and this is all pulled in to the various parts of the webpage. This is done in realtime and therefore means a lot of work is happening to render the page for the user.
For large websites, this is typically the de-facto way to build a site as it can make managing the content a lot easier due to the ease with which you can update the information. Instead of having to manually edit the code across loads of web pages you can just update one database record and then that info is pulled in to every page where needed dynamically.
On the flip side, a static site is, well, static. The website has no 'back-end' to speak of. So this means no database, no queries happening in realtime, no pulling in content dynamically. The site is pre-built with all the HTML, CSS, assets, and Javascript.
Benefits of a Static Site Vs. a Dynamic site
** Security: ** No database = no database security concerns!
** Cheap to host: ** Due to the lack of complexities static sites are really, really cheap to host. They typically need very little server resources and no additional database cost. Static sites lend themselves brilliantly to 'serverless' hosting which has the added advantage of not requiring to manage and maintain the security & updates of a server. dwe.dev itself is hosted on Netlify and it costs the grand total of $0.00 a year
** Cheaper to build: ** In most cases a static site will be cheaper to build and quicker to get up and running. There is very little configuration needed and the web developers/designers can focus on building the pages, not the backend.
** Speed: ** With the absence of having to query a database and the pages being prebuilt, static sites are typically insanely fast out of the box.
** Search Engine Optimisation: ** Plain HTML markup means that SEO is exceptionally easy to get right and lessens the technical considerations. What you see is what you get and search engines have an easy time indexing all content. Speed is also a huge SEO leg up as Google announced, back in 2010, page speed is an important ranking factor in the algorithm. This is becoming ever more important with mobile being the major device for traffic.
** Static ≠ feature-poor: ** Whilst a static site sounds like it may be feature-poor, this is not the case. With the advent of serverless, you can have a static website call APIs and serverless functions, such as AWS Lambdas or Azure Functions, that carry out the heavy lifting and return the result. In effect this shift in thinking allows a static site to be just as complex as a dynamic site with the right architecture.
** Static AND Content Management System you say: ** To retract a notion from previously. Being static does not mean you can not have CMS functionality to manage content easily without having to get lost in code! Netlify CMS makes it insanely easy to add in the benefits of an easy-to-use CMS to a static site. This means you, as the end-user, can add blog posts, edit page content, and even add new pages without having to touch a single line of code.
Examples of Static Sites
Below are a few examples to show you what the art of the possible is with static sites. The following examples have all been built on Gatsby which is a well-established framework based on React
- https://dwe.dev
- https://impossiblefoods.com/
- https://airbnb.io/
- https://www.nike.com/ - yep, even Nike's e-commerce site is built with Gatsby!
In Summary
I have seen a lot of instances where clients have relatively straight forward 'brochureware'/informational websites and get lumbered with the costs of developing a fully dynamic site. On top of the inflated upfront development costs they then typically get a marked-up web hosting bill which further adds unnecessary costs.
If you have a site that has limited functionality and is not needing to be updated every day/week then I really recommend you review your options and do not just get lumbered with the standard offering an agency may force on you.
There absolutely will always be a place and a solid use case for dynamic sites! But a lot of clients do not even know there is an alternative and with the combination of a robust specification & use case, you will hopefully be able to make a more informed decision about how your next website should be built.