Skip to content

Commit

Permalink
Review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick committed Dec 6, 2017
1 parent 696c8fd commit 0f7b12b
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions packages/workbox-range-requests/Plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ import {createPartialResponse} from './createPartialResponse.mjs';
import './_version.mjs';

/**
* A class implementing the `cachedResponseWillBeUsed` lifecycle callback.
* This makes it easier to add in support for used cached responses to fulfill
* requests with `Range:` headers.
* The range request plugin makes it easy for a request with a 'Range' header to
* be fulfilled by a cached response.
*
* If an incoming request does contain a `Range:` header, then the appropriate
* subset of the cached body will be returned as part of a HTTP 416 response.
*
* If the incoming request does not contain a `Range:` header, then the cached
* response will be used as-is.
* It does this by intercepting the `cachedResponseWillBeUsed` plugin callback
* and returning the appropriate subset of the cached response body.
*
* @memberof workbox.rangeRequests
*/
Expand All @@ -34,10 +30,9 @@ class Plugin {
* @param {Request} options.request The original request, which may or may not
* contain a Range: header.
* @param {Response} options.cachedResponse The complete cached response.
* @return {Promise<Response>} If request contains a Range: header, then
* a Response with status 206 whose body is a subset of cachedResponse. If
* request does not have a Range: header, then cachedResponse is returned
* as-is.
* @return {Promise<Response>} If request contains a 'Range' header, then a
* new response with status 206 whose body is a subset of `cachedResponse` is
* returned. Otherwise, `cachedResponse` is returned as-is.
*
* @private
*/
Expand Down

0 comments on commit 0f7b12b

Please sign in to comment.