Display "(from memory cache)" when loading ServiceWorker-produced resources from memory cache.
Bug: 881961
Change-Id: Ie58d071b3a80f48274991eaed799fc144da1d6a1
Reviewed-on: https://chromium-review.googlesource.com/1214046
Reviewed-by: Dmitry Gozman <[email protected]>
Commit-Queue: Ben Kelly <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#590358}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 82a2dd3499e33caf58ab9dd13124d2ac8fb724b3
diff --git a/front_end/network/RequestHeadersView.js b/front_end/network/RequestHeadersView.js
index 5c5b4de..520161f 100644
--- a/front_end/network/RequestHeadersView.js
+++ b/front_end/network/RequestHeadersView.js
@@ -393,17 +393,17 @@
const statusTextElement = statusCodeFragment.createChild('div', 'header-value source-code');
let statusText = this._request.statusCode + ' ' + this._request.statusText;
- if (this._request.fetchedViaServiceWorker) {
+ if (this._request.cachedInMemory()) {
+ statusText += ' ' + Common.UIString('(from memory cache)');
+ statusTextElement.classList.add('status-from-cache');
+ } else if (this._request.fetchedViaServiceWorker) {
statusText += ' ' + Common.UIString('(from ServiceWorker)');
statusTextElement.classList.add('status-from-cache');
} else if (this._request.redirectSource() && this._request.redirectSource().signedExchangeInfo()) {
statusText += ' ' + Common.UIString('(from signed-exchange)');
statusTextElement.classList.add('status-from-cache');
} else if (this._request.cached()) {
- if (this._request.cachedInMemory())
- statusText += ' ' + Common.UIString('(from memory cache)');
- else
- statusText += ' ' + Common.UIString('(from disk cache)');
+ statusText += ' ' + Common.UIString('(from disk cache)');
statusTextElement.classList.add('status-from-cache');
}
statusTextElement.textContent = statusText;