Cache then Network

This recipe illustrates methods to return network requests from either the cache or network.

Difficulty

Beginner

Use Case

One advantage to using service workers is having programmatic control over what you return from cache and what you prefer to load from server.This example provides you a front-end to experiment with that choice.

Features and Usage

  • Configure form to allow or disallow cache and/or network
  • Click “Get new data” to execute requests

Category

Performance


Has it been useful?

Tell us what you think of this recipe by leaving a comment!