Hybrid Model

A hybrid static/dynamic model uses both static and dynamic components. The static components are provided by a lightweight PHP based framework. This allows the menus, header and footer to be pulled in and combined with the typical static page content without the weight of an entire content management system such as WordPress. As the standard content management system is comprised of thousands of lines of code that are changed regularly, it is fragile and prone to security breaches when these changes are made. Thus regular monitoring is needed to ensure everything is working as it should.

In contrast, the static components use only a few hundred lines of code. Once written and verified, they can be left to run unattended for much longer periods of time. If something does happen to them, it is much easier to inspect, determine what happened and make a fix. The standard content for a website includes a home, about and contact page, as well as a terms and privacy page. Once well constructed, there should be little need for these to change. If they are rolled into a lightweight and stable framework comprised of only a few hundred lines, they should be able to run safely for years and years.

The part of a website that is dynamic is the blog or news section. As this is often represented by the url: https://www.example.com/blog/ or https://www.example.com/news/ the entire WordPress installation (or other CMS for that matter, such as Joomla! or Drupal) could be put in this folder. If something happens to the installation (it is hacked or goes down for some other reason), the rest of the site will continue to run happily without being affected. The page that does go down (the news or blog page), could be constructed to degrade gracefully to show the same style of page, just that it is not available.

It would be a useful exercise to break out of the “WordPress-Only” mindset. WordPress delivers HTML, and it is the HTML that is viewed in the browser. WordPress is not needed to generate HTML. This can be done directly, by writing static HTML files, or by generating them in a simpler fashion using a lightweight PHP framework. This has already been developed and has been running for a number of years with no changes to the underlying code structure and no updates.

If this model were followed, then not only would the dependence on a complex and fragile code set be broken, but it may also reduce the total life cycle cost of maintenance. As the critical parts of the website are more stable, rather than having the developer be called in almost immediately if something happens to the WordPress component on a hybrid site, a day or a couple of days could elapse without great harm being done. The main parts would still be fully accessible. Another benefit is that the simple PHP only framework results in much faster page load times. No caching is needed. Everything just works better.

Finally, many websites are developed in response to a new idea or a new business. When an idea or business is just starting out, there may be less detail or information available. In my experience, it seems a waste of time and bandwidth to have to upload 15 to 20 MB of files to deliver less than a megabyte of information. Once the business or idea has shown some promise, the decision can be made to add the WordPress component. For those who may not want to do this, another option would be to create a subdomain called blog.example.com and then attach a hosted blogging service, such as Blogger to that subdomain. In this manner there should be no ongoing maintenance, as the hosted service takes care of all the underlying mechanics and the lightweight PHP framework chugs happily away, doing what it does best, delivering HTML pages.

Thin PHP Internet Concept  Next »