


Co-Authored by: Jake Story & Max Glantzman
In which our heroes have a fireside chat about adventures in website flattening:
Marketing and Business Implications by Max: I recently spoke to our Senior Developer, Jake Story, about the page flattening functionality we have developed for Common Goal WebManager. This functionality is useful on any web site since it virtually eliminates the chance of server side errors, but is especially important for sites expecting a high amount of traffic. Jake explains what it is and how it works below. Our own Common Goal WebManager gives you a simple user interface to manage everything we are describing below! If you have any questions, please don’t hesitate to contact us.
Max: The first time that I’d ever heard of flattening a web site was Slashdot, which I was a fan of a while back and I remember them talking about how their site used to crash a lot prior to doing this, so maybe you can explain exactly what this is and how it differs from the more conventional delivery of dynamic content on a CMS.
Jake: Well, the dynamic delivery of content, especially through a CMS, comes from a myriad of places: a database which might connect to other databases which might create objects in the backend and do a whole bunch of server side processing before eventually giving you some HTML that’s delivered to the browser and interpreted on the screen. All that stuff takes time and takes processing power and takes utilities, if that happens enough, the server can run out of processor cycles, can run out of memory, can run out of a bunch of things that can bring the page down or the site down.
The idea of flattening is trying to get your dynamic content on the page or pages you want them on but without having to do all of that server side processing and without having to hit a database. Sites that would benefit from this are database driven sites that receive a high amount of traffic.
Max: So if you eliminate the database hits and server side processing, you gain a performance increase but lose the real time dynamic content that those two functions provide. Is there a way to get any of the dynamic pieces back on a flattened page?
Jake: Normally, and is the case with the dynamic pages we are talking about, the code that runs to generate the HTML that’s eventually delivered to the browser is all done on the server before the page is ever received by the user. By the time the page shows up, the server side code has already been run. This flattening system circumvents that whole process. When you click on a certain page it loads up one file, the code that gets loaded by the browser is always the same.
Javascript and Ajax can provide a middle ground in delivering a flattened page, but with dynamic content. Once the page is loaded, ajax or javascript can get some data from the server and manipulate the front end to display content like newer news items. All of that stuff has to be done after the page has loaded, so it’s definitely not completely flat, it's more like “flat-ish”.
Max: If we’re hitting a server through ajax to get certain pieces of a page, where does this tie into something like Common Goal WebManager and how can a database driven CMS connect up with the concept of flattening?
Jake: It depends on the site, the content, the design, and the frequency with which a page is refreshed. If you have a page where new content is pulled in, depending on how often that new content is pulled in, you may want to have the new content pulled in through ajax, which has pros and cons. One of the pros is that you can have a flattened page that still has some dynamic content as I mentioned. A con is that one of the benefits you’re trying to gain by having a flattened page, i.e. avoiding hitting the server, is gone because there is a server hit when you do an ajax call.
A third option is to have the page can be completely flat but automatically refreshed on a scheduled basis, much like the Slashdot example. Whether it’s every day, every three hours, or every fifteen minutes, it is still better than having potentially thousands of people making causing these database hits on every visit.
The other option available with Common Goal specifically is allowing certain functionality to occur when certain actions are taken in WebManager. For example, with news items, we can have the home page flatten only when a new news item is created. That way, it may refresh once a day, it might refresh twice a day, it might even just be once a week. Either way it doesn’t need to refresh more often than it does because it will always remain as current as the most recent news item.
Questions? Comments? Find us on Twitter at twitter.com/silverscape.