Set the cache-control header's max-age value to 0s for DevTools.

This ensures that the `index.html` file (which determines whether to
load the new service worker and therefore invalidate the cache) will
always be fresh.

Bug: https://github.com/flutter/devtools/issues/3896
Change-Id: Ib0b6adda66b7dd926f57724f21c2a7c6284bce60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237842
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
This commit is contained in:
Elliott Brooks
2022-03-18 22:46:02 +00:00
committed by Commit Bot
parent 843a31fe45
commit 9f4d5b6e4a
+1 -1
View File
@@ -276,7 +276,7 @@ class DevToolsServer {
// Ensure browsers don't cache older versions of the app.
_server.defaultResponseHeaders.add(
HttpHeaders.cacheControlHeader,
'max-age=900',
'max-age=0',
);
// Serve requests in an error zone to prevent failures