Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Um.. Why cant the blog be static and have a dynamic webapp hanging off /admin/ which operates as a static site generator? The only difference would be that a program on the web server creates the static files and copies them to the correct directories, instead of a local program creating the static files and copying them to the correct directories.

Edit: I should clarify that I am refering to programs that create static html files. I read the story as dynamic == generates html from some other stored format, be it database or flat files in rst.



That's how Movable Type used to work. People complained how it took forever to regenerate a big site on a shared host.


The question is: When do you generate the files? Regenerating a large number of file every time you modify something is just bad design (much like regenerating every time a document gets requested). You're better off having a tiny script on each page that checks for modifications when requested and rebuilds if needed (to avoid scripting on the front-end you can use <img> to rebuild for the second request). Alternatives would be to have background processing or batch modifications.


Angerwhale basically does this. Every page has dependencies, and when the page is requested, it is served from cache unless the dependencies have changed. Otherwise, it is regenerated.

Yes, this is not as efficient as static files, but you can drop a file in your directory and it will render as a blog post as soon as someone wants to read it (or a page that links to it somewhere).


Isn't that the whole concept behind caching+sweepers in Rails?


One of the reasons listed was better security by having no code executed on the server. That argument falls apart if you're willing to have some code running.


Nah, sorry. You're taking the logic here too far. Having no code accessible pre-auth is a huge win. Only having to worry about the authentication attack surface is a drastic improvement over Wordpress, which stores admin accounts in the same database table as anonymous blog commenters.


The webserver and OS are not code?

Oh, you mean world-accessible PHP scripts. That's easy to fix by letting your webserver handle authentication to /admin.


Code that has write-permission to anything fancy.

I'm in pedantic territory here, I don't particularly mind the idea of generating static files. My personal opinion is that having a dynamic frontend with fast caching for the most popular views is a better solution for that vast majority of CMS/blog (ie: dynamic) sites out there.

What I do mind, are "I use semi-obscure technology X, here's why X is better than established, proven and hugely popular technology Y in every conceivable way" style ego-boosting articles. I'd rather read a show and tell about how this technology solved a real-life problem for you. I also enjoy the honesty of acknowledging the shortcomings.


Drupal can also do this with the Boost module. Boost is very similar to WP-Supercache, except it has a multi process crawler to push the site out faster and some fairly smart cache expiration settings. Also caches AJAX & XML & Pages with URL variables. GPL2 - http://drupal.org/project/boost




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: