update-nocookie-worker.py (488B)
1 import random 2 import time 3 4 def main(request, response): 5 # no-cache itself to ensure the user agent finds a new version for each update. 6 headers = [(b'Cache-Control', b'no-cache, must-revalidate'), 7 (b'Pragma', b'no-cache')] 8 9 # Set a normal mimetype. 10 content_type = b'application/javascript' 11 12 headers.append((b'Content-Type', content_type)) 13 # Return a different script for each access. 14 return headers, u'// %s %s' % (time.time(), random.random())