Browser - Fetching Resources (Request/Response)

1 - About

Fetching is a web term that means:

The response includes generally a resource but it could also be empty.

User agents can implement a variety of transfer protocols to fetch resources such as:

3 - Processing Model

When a user agent is to fetch a resource or URL:

  • optionally from an origin,
  • optionally using a specific referrer source as an override referrer source,
  • and optionally with any of a synchronous flag, a manual redirect flag, a force same-origin flag, and a block cookies flag,

it must follow this processing model.

4 - Type

A web site (HTML, Javascript or CSS) can fetch two types of resources from a server:

4.1 - Data

A web site (HTML, Javascript or CSS) is able to receive data resources (such as HTML, XML, or JSON documents) from:

4.2 - Media

Media resources such as images, JavaScript, CSS, or fonts can be included from any origin, even without permissive CORS headers.

Cross-Origin Read Blocking (CORB) prevents the fetch of a cross-origin data resource.

5 - Management

5.1 - Priority

5.2 - Type

See:

5.3 - Origin

The origin request header indicates where a fetch originates from.

6 - Library

  • Swr React Hook :
    • https://swr.now.sh/ - stale-while-revalidate with a HTTP cache invalidation strategy popularized by RFC 5861 - SWR first returns the data from cache (stale), then sends the fetch request (revalidate), and finally comes with the up-to-date data again.

7 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap