Redirect to cached page when No internet connection

748 views Asked by At

There are two pages A & B. Page A is normal Html page while Page B Html page using Cache Manifest.

Task: If Internet Connection is not available, Page A redirects to Page B.

Issue: As redirection use HTTP Request, Page B is not loaded showing No Internet connection

Is there any way to redirect from Page A to Page B?

1

There are 1 answers

0
Julius Dzidzevičius On BEST ANSWER

Have you tried to provide a FALLBACK header in your manifest?

# Fallback content
FALLBACK:
. example.html

If the (request) attempt fails, due to either a network failure or a server error of some kind, the browser loads the file example.html instead.

https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache