CachedResponse Class

A response of a cache entry (https://fetch.spec.whatwg.org/#concept-response). The status, the headers, the URL list and the body of an opaque response are the ones of its internal response (the scripts only see its filtered response, e.g. a status of 0 and no body): a service worker can give it to a page (e.g. a cross-origin script).

public sealed class CachedResponse

Constructors

NameDescription
CachedResponse()

CachedResponse()

CacheStorageBackend.cs
public CachedResponse()

No documentation is available.

Properties

NameDescription
BodyGets the body, or null for a response without body.
CrossOriginResourcePolicyGets the Cross-Origin-Resource-Policy header of the response, or null: the header of an opaque response, whose CachedResponse.Headers are empty, for the cross-origin resource policy check.
HeadersGets the headers.
RangeRequestedGets whether the request of an opaque response had a Range header (https://fetch.spec.whatwg.org/#concept-response-range-requested-flag): its range response (206 or 416) is a network error for a no-cors request without Range header.
RequestIncludesCredentialsGets whether the request of the response included the credentials (https://fetch.spec.whatwg.org/#response-request-includes-credentials), for the cross-origin resource policy check of the opaque responses.
StatusGets the status.
StatusTextGets the status message.
TypeGets the type (basic, cors, default, opaque...).
UrlListGets the URLs of the response (the last one is its URL), or an empty list.

Gets the body, or null for a response without body.

public ReadOnlyMemory<byte>? Body { get; init; }

Property value

ReadOnlyMemory<byte>?

CrossOriginResourcePolicy

CacheStorageBackend.cs

Gets the Cross-Origin-Resource-Policy header of the response, or null: the header of an opaque response, whose CachedResponse.Headers are empty, for the cross-origin resource policy check.

public string? CrossOriginResourcePolicy { get; init; }

Property value

string?

Gets the headers.

public IReadOnlyList<KeyValuePair<string, string>> Headers { get; init; }

Gets whether the request of an opaque response had a Range header (https://fetch.spec.whatwg.org/#concept-response-range-requested-flag): its range response (206 or 416) is a network error for a no-cors request without Range header.

public bool RangeRequested { get; init; }

Property value

bool

RequestIncludesCredentials

CacheStorageBackend.cs

Gets whether the request of the response included the credentials (https://fetch.spec.whatwg.org/#response-request-includes-credentials), for the cross-origin resource policy check of the opaque responses.

public bool RequestIncludesCredentials { get; init; }

Property value

bool

Gets the status.

public int Status { get; init; }

Property value

int

Gets the status message.

public string StatusText { get; init; }

Property value

string

Gets the type (basic, cors, default, opaque...).

public string Type { get; init; }

Property value

string

Gets the URLs of the response (the last one is its URL), or an empty list.

public IReadOnlyList<string> UrlList { get; init; }

Property value

IReadOnlyList<string>