Two people tap the same link. On one device, the request never reaches the server. On the other, the server replies that it cannot handle the request right now. The page has failed for both readers. The browser has seen two different events.

When the network fails, fetch may reject the request. An HTTP 503 arrives as a response at the transport level. The application still has to interpret the status. If a reading copy is already stored, a deliberate fallback policy can present it with its date and a note explaining that the information came from the device.

A page can be available when the connection is not

A service worker can respond to navigation requests with resources the browser has already saved. The page, the stylesheet and the other files it needs can be prepared on an earlier visit. A first visit without internet is a different situation. It depends on whether a copy is already present on the device.

A feature can still be useful several days after it was saved. Information that will guide an immediate decision needs a clearer date and a way to check the current version.

Sources in this section 31

The question experiment 028 put to the test

The lab distinguished a lost connection, a temporary response and normal service. We repeated six scenarios in Node.js with simulated responses and compared them with the earlier record. A copy was already available. The test confirmed that, in the observed model, the branch that handled a network failure behaved differently from the one that received a 503 response.

The table uses an independent teaching model. It compares a policy that falls back only after a transport failure with one that also looks for a validated public copy after a 503 response. Conditions were controlled. The real cache, response times and behaviour on physical devices during an outage still need to be measured.

Behaviour of the teaching model, with a local copy where indicated.
Simulated scenarioNetwork failure onlyNetwork failure or HTTP unavailability
Server availableCurrent versionCurrent version
Network unavailable and copy presentDated copyDated copy
HTTP 503 and copy presentTemporary noticeDated copy
HTTP 503 with no copyTemporary noticeTemporary notice

Sources in this section 124

Keep the article available without pretending it is current

A recovery policy needs to know which material is public, what can be saved and when it should stop presenting it. Private requests stay outside a public copy. Error responses should not replace usable material already on the device.

The test that matters to a reader can be put in one sentence. After a successful visit, what can I open again, and when was it saved? Showing the origin of the copy answers both parts.

Sources in this section 34

Sources and references

  1. MDN · What happens when fetch receives an HTTP response
  2. MDN · What HTTP 503 means
  3. MDN · Caching in progressive web apps
  4. ScopeLink Lab · Teaching data for the reading recovery comparison (Portuguese)

Sources reviewed on .