The Resurgence of Static
The Resurgence of Static
The combination of the speed, performance, and security of static sites, mixed with the functionalities of dynamic sites, has started a new trend in web development.
Join the DZone community and get the full member experience.Join For Free
The Move From Static to Dynamic
We saw the emergence of dynamic when the constraints of static failed to meet the new demands of the web. They were hard to update and did not allow for dynamic navigation and user interactivity. In order to maintain timely and relevant websites, companies started to store their content in databases and dynamically deliver it to their site visitors. This spurred the growth of content management systems (CMS), which allowed for the managing of content and files that could be dynamically displayed on different pages and areas of a website. A CMS meant that a content editor could update the content of a page or site and their changes would be reflected instantly, without having to use FTP or know HTML. These dynamic publishing platforms unleashed the tidal wave of online publishing that has changed our world and how we consume information.
And Back to Static Again
However, due to constraints, such as the amount of server horsepower needed to dynamically publish, the amount of system admins needed to run a large scale production site, security issues and more, we’ve seen static start to make a comeback.
This doesn’t mean we’ve gone back to plain HTML sites and gotten rid of the CMS completely, but as a development community, we’ve come to a happy medium that brings together the database needs of dynamic with the advantages of static - speed, scalability, security, and performance.
Benefits of Static
Caching and Performance
Dynamic sites began to show an impact on performance due to the complexity of dynamic code running on a server for every request, which slowed down the site speed. To combat performance issues, developers depend on the caching of a site. Caching tends to be tricky and even when done well, a cached, dynamic site is almost always significantly slower than a static site. This is because, in a dynamic site, changes to a comment, global website setting, tag, category, or other content need to constantly be updated in the cache. However, with static, a URL will show the same HTML to any site visitor until the corresponding file is updated. This is why static sites almost always show an increase in performance and uptime vs. dynamic sites.
Static Sites and Modern Browsers
When static sites first made their debut, the web browser was also in its infancy. Today’s browser, however, is much more mature and is capable of running full-fledged web applications on its own. That’s a huge benefit to static sites as it makes it easier to utilize web apps for comments on articles, social sharing of content, site search, and more.
Static Sites and CDNs
Unlike dynamic sites which may require some workarounds, static sites can easily be deployed directly to a CDN, like Amazon S3. This is an area where dotCMS shines, as it allows users to get a static representation of their site and push publish it to Amazon S3 - speeding up the delivery of content for websites with high traffic and global reach.
Finding the Happy Medium
Before you jump straight into a static site, consider the business advantages and disadvantages of going static and what technology is best to use to generate your site.
As mentioned above, static sites are fast. There are no database queries to run, no templating, and no processing on every request, which speeds the site up significantly.
When you run a static site, there are no software patch releases or version updates to worry about. While there are ways to “attack” a static site, they have nothing to do with your CMS software - everything is as safe as you can architect it!
Optimized Version Control - Hello Retention and Backups!
Whether it’s for disaster recovery or file management, version control within a static site is simple and effective.
A huge influx of traffic to a website can bog down the site, and can even render it almost useless. Static is better prepared to handle large amounts of web traffic as it consumes a very small amount of server resources.
Real-time Content Can Be Tricky
Static in Today’s World
In the end, static sites are not right for every business. Some still rely on the real-time aspect of dynamic and its ability to immediately show template and other content changes. For these businesses, static doesn’t make sense. For others, however, static has come a long way from the beginning of the web and improves the speed, security, scalability, and performance of a website.
Published at DZone with permission of Alexandra Barcelona . See the original article here.
Opinions expressed by DZone contributors are their own.