summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/update-nocookie-worker.py
blob: 0f09b7e32c03c3724cbb55e88f19c0b9b4d78db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import time

def main(request, response):
    # no-cache itself to ensure the user agent finds a new version for each update.
    headers = [('Cache-Control', 'no-cache, must-revalidate'),
               ('Pragma', 'no-cache')]

    # Set a normal mimetype.
    content_type = 'application/javascript'

    headers.append(('Content-Type', content_type))
    # Return a different script for each access.  Use .time() and .clock() for
    # best time resolution across different platforms.
    return headers, '// %s %s' % (time.time(), time.clock())