summaryrefslogtreecommitdiff
path: root/utils.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-07 12:16:35 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-07 12:16:35 +0200
commit0161b4b655e549d57fef122cabae5d4e380a4e95 (patch)
treeb7286abc28ab2aeab805341abc7aa472688ac0db /utils.lisp
parentb388b7c6921d9661b474b7acd1a3ea5748bfeb37 (diff)
Implement sane caching behaviour.
Ignore-this: 8ed0815613cb44c0eee9d8ac47e1753b darcs-hash:e41ff965d8172b7979369cb0df98302f29a9a9c4
Diffstat (limited to 'utils.lisp')
-rw-r--r--utils.lisp10
1 files changed, 10 insertions, 0 deletions
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)