Commit fc402029 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[Supersize] HTML Viewer: Do not cache .ndjson files when fetching from server.

The current code (using fetch() API) seems to always use cached .ndjson
file, even when server is restarted (on a different .ndjson file), and
Shift-Ctrl-R is used to refresh. This CL changes API use to disable
cache, so when .ndjson files are loaded by data_url, refreshing the
HTML viewer would fetch the up-to-date version.

There does not appear to be a performance cost to this.

Bug: 880671
Change-Id: I9aab99c18895dc52bc9de0ec788c1c617ec06e8f
Reviewed-on: https://chromium-review.googlesource.com/1225652
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591290}
parent e1cdcf31
......@@ -506,7 +506,10 @@ class DataFetcher {
async fetch(url) {
if (this._controller) this._controller.abort();
this._controller = new AbortController();
const headers = new Headers();
headers.append('cache-control', 'no-cache');
return fetch(url, {
headers,
credentials: 'same-origin',
signal: this._controller.signal,
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment