michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: function handleRequest(request, response) michael@0: { michael@0: var Etag = '"4c881ab-b03-435f0a0f9ef00"'; michael@0: var IfNoneMatch = request.hasHeader("If-None-Match") michael@0: ? request.getHeader("If-None-Match") michael@0: : ""; michael@0: michael@0: var page = "
hello world!
"; michael@0: michael@0: response.setHeader("Etag", Etag, false); michael@0: michael@0: if (IfNoneMatch == Etag) { michael@0: response.setStatusLine(request.httpVersion, "304", "Not Modified"); michael@0: } michael@0: else { michael@0: response.setHeader("Content-Type", "text/html", false); michael@0: response.setHeader("Content-Length", page.length + "", false); michael@0: response.write(page); michael@0: } michael@0: }