No more missing include files
I had this problem where you’d visit the front page of kryogenix and all you’d see is, "Missing include file ../days/posts.html". The reason for this was that posts.html is a file created by Vellum that lists the last n posts, which is funkily cached, i.e., it doesn’t exist until someone does an HTTP request for it. Now, the front page of kryogenix does an SSI include of that file, but it tries to include it as a file, not by doing a request. So, every time any entry in posts.html got "rebuilt" (i.e., deleted), the front page stopped working because the file wasn’t there to include!
Oops.
So I fixed it by making the front page do an HTTP request for the file instead:
<?cas
import urllib
pfp = urllib.urlopen(”http://www.kryogenix.org/days/posts.html”)
response.write(pfp.read())
pfp.close()
?>
I do like Castalian.
Why not just use #include virtual=“” with a relative URL rather than #include file=““? The former will trigger an Apache subrequest, which should call Vellum in the same way as a real HTTP request. Calling through urllib is, as the previous poster said, massively inefficient, and you seem to be losing yourself laziness points with the current solution. :-)
-1801 seconds later
Why not just use
Hey, rather than doing this (which, you have to admit, is an inefficient hack), why not alter Vellum to trigger generation by a function call, and not just by HTTP request?The overhead of the URLLib call, the response handling, the stream buffering, etc. is pretty bad.And you’d get looser coupling between HTTP and your CMS, too.(I admit, I’ve not looked at Vellum code, so I could be completely off.)
-1741 seconds later
Leave a Reply
other places here