cache-304.py (477B)
1 def main(request, response): 2 match = request.headers.get(b"If-None-Match", None) 3 if match is not None and match == b"mybestscript-v1": 4 response.status = (304, b"YEP") 5 return b"" 6 response.headers.set(b"Access-Control-Allow-Origin", b"*") 7 response.headers.set(b"Cache-Control", b"must-revalidate") 8 response.headers.set(b"ETag", b"mybestscript-v1") 9 response.headers.set(b"Content-Type", b"text/javascript") 10 return b"function hep() { }"