TextPattern

Whether I move to TextPattern or not, crawling inside the code has been very interesting. The heart of the publishing process is a call to preg_replace_callback, a regular expression search and replace using callbacks. In TextPattern, the regex identifies each layout tag and the callback uses the matching text to determine what function is responsible for the replacement text. Worth the price of admission by itself.

I’m currently on the trail of better HTTP 404 and 304 responses. TextPattern pages are dynamically generated, and it currently responds to bad requests with an empty template. I added some code to keep track of the articles retrieved and bingo &ndash 404 Not Found and 304 Not Modified are a going concern. A little more time to sort out comments and I can move on to 304 handling for style sheet requests.