pvaneynd: (Default)
pvaneynd ([personal profile] pvaneynd) wrote2004-09-29 09:07 pm

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.