My Common Lisp and Debian blog. For more off topic rants and stuff please see my livejournal blog.

Wednesday, September 29, 2004

nugget of code

Suppose you have a feature debug that you use to turn on debugging, and that if debug is on *features* you want to araneida not to cache your responses for a day. Then you can use the following code:


(araneida:request-send-headers
request
:content-type "text/html"
;; cache this page for 24h
#-debug #-debug
:expires (+ (get-universal-time) (* 60 60 24)))


The #-debug #-debug will exclude both expressions that follow. Another neat trick I've learned from Erik Naggum.

No comments: