OLD | NEW |
(Empty) | |
| 1 import os |
| 2 import time |
| 3 |
| 4 def main(request, response): |
| 5 # update() does not bypass cache so set the max-age to 0 such that update() |
| 6 # can find a new version in the network. |
| 7 headers = [('Cache-Control', 'max-age: 0'), |
| 8 ('Content-Type', 'application/javascript')] |
| 9 with open(os.path.join(os.path.dirname(__file__), |
| 10 'update-worker.js'), 'r') as file: |
| 11 script = file.read() |
| 12 # Return a different script for each access. |
| 13 return headers, '// %s\n%s' % (time.time(), script) |
| 14 |
OLD | NEW |