Dynamic vs Static

18Nov02

Phil Ringnalda proposes a “Half-baked, and a little fried” hybrid dynamic/static weblog system:

While browsing through Rasmus’s Tips and Tricks slides from his talk at PHPCon, I think I found my answer (on page 25 of the accursed PDF file), in what he calls “funky caching.” It works like this: you redirect 404 errors to a PHP script, which looks at the requested URL, decides whether it should actually exist, and if it should it builds the file from the database, saves it to the filesystem, and then returns the page to whoever requested it. Next time that URL is requested, the static file will be served.

“Funky caching” could be useful for a static publishing system as well. Weblog archives can consume a great deal of space, yet those pages are infrequently requested. Why not GZip entries from previous months and use a 404 handler to extract pages as-needed?

I was considering doing that a few months ago because my web hosting account was brushing against quota limits.


 


Flickr Photos