From 0161b4b655e549d57fef122cabae5d4e380a4e95 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 7 Oct 2009 12:16:35 +0200 Subject: Implement sane caching behaviour. Ignore-this: 8ed0815613cb44c0eee9d8ac47e1753b darcs-hash:e41ff965d8172b7979369cb0df98302f29a9a9c4 --- utils.lisp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils.lisp') diff --git a/utils.lisp b/utils.lisp index 74030b8..590d310 100644 --- a/utils.lisp +++ b/utils.lisp @@ -325,3 +325,13 @@ ELEMENT-TYPE as the stream's." (submitter-user-agent comment) (spamp comment) (body-of comment)))) + +(defun revalidate-cache-or-die () + #+clisp + (let ((time (cybertiggyr-time:parse-time *if-modified-since*))) + (when (and (integerp time) (>= *if-modified-since* (compute-journal-last-modified-date))) + (http-add-header "Status: 304 Not Modified") + (http-send-headers) + (ext:quit 0))) + #-clisp + nil) -- cgit v1.2.3