Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/update-worker.php

Issue 1380323002: Make registration.update() no longer force bypassing the HTTP cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <?php 1 <?php
2 // Force the browser to cache this script. update() should always bypass this 2 // update() does not bypass cache so set the max-age to 0 such that update()
3 // cache and fetch a new version. 3 // can find a new version in the network.
4 header('Cache-Control: max-age=86400'); 4 header('Cache-Control: max-age=0');
5 5
6 // Return a different script for each access. 6 // Return a different script for each access.
7 header('Content-Type:application/javascript'); 7 header('Content-Type:application/javascript');
8 echo '// ' . microtime(); 8 echo '// ' . microtime();
9 ?> 9 ?>
10 10
11 importScripts('../../resources/test-helpers.js'); 11 importScripts('../../resources/test-helpers.js');
12 importScripts('../../resources/worker-testharness.js'); 12 importScripts('../../resources/worker-testharness.js');
13 13
14 var events_seen = []; 14 var events_seen = [];
(...skipping 11 matching lines...) Expand all
26 e.respondWith(new Response(events_seen)); 26 e.respondWith(new Response(events_seen));
27 }); 27 });
28 28
29 self.addEventListener('message', function(e) { 29 self.addEventListener('message', function(e) {
30 events_seen.push('message'); 30 events_seen.push('message');
31 self.registration.update(); 31 self.registration.update();
32 }); 32 });
33 33
34 // update() during the script evaluation should be ignored. 34 // update() during the script evaluation should be ignored.
35 self.registration.update(); 35 self.registration.update();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698