Added a simple cache-helper function.
[wrw.git] / wrw / resp.py
index 24896ba..159126a 100644 (file)
@@ -71,3 +71,9 @@ class redirect(dispatch.restart):
         req.status(self.status, "Redirect")
         req.ohead["Location"] = proto.appendurl(proto.requrl(req), self.url)
         return []
+
+class unmodified(dispatch.restart):
+    def handle(self, req):
+        req.status(304, "Not Modified")
+        req.ohead["Content-Length"] = "0"
+        return []