Static Page Loading - the ultimate cache cause look ma, no PHP!

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Aki Tendo's picture

For a few years I worked for some time trying to setup my own CMS system to handle smaller scale tasks than what Drupal, or even Wordpress is targeted at. While I've moved on after conceding defeat a the enormity of the task (and never really having enough time for it around paying work) there is one concept from it that I feel is ripe from exploration - using a static cache. Not what Drupal does now might you, but a true static cache.

The approach hinged on moving all, and I do mean all, asset files out of the directory the web server reads leaving the web directory clean of any php files except for one entry point - but not index.php, rather landing.php The reason for the weird name is it isn't a natural name, and it allows an index.html or index.php file to be written into the web directory.

The scheme hinged on doing as much build time work on the page as possible and running pages through in one of two modes. The first, pure html, would mean that once the page is built out in the admin panel an html file would be written for the page for the webserver to hit at its leisure. If the file was missing the system would build it, send it to the user and write it to the file system for the next pass through.

The second would be full dynamic, which is what we have now - drupal delivers the page with all the overhead that entails.

Pages which did have different behaviors for logged in users from anonymous visitors would have a very tiny PHP snippet at their head that would start the session and see if a session flag var was set, and/or check if a logged in cookie was set. If so it would then do a full dynamic build of the page (during which the validity of the cookie would of course be tested).

Drupal is still in the age of upload the files to the webserver and hit the site to install. For all its problems there is an elegance to this simplicity for new users. However, how many users does drupal still have that need that level of simplicity?

It's a thought worth kicking around but not too seriously since its a ways down the road.