-
Notifications
You must be signed in to change notification settings - Fork 388
Move to a single cache for all responses #123
Conversation
@@ -181,7 +181,7 @@ function generate(params, callback) { | |||
var runtimeCaching; | |||
var swToolboxCode; | |||
if (params.runtimeCaching) { | |||
var pathToSWToolbox = require.resolve('sw-toolbox/sw-toolbox.js'); | |||
var pathToSWToolbox = require.resolve('sw-toolbox/build/sw-toolbox.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, my bad. I read through the list of commits to decide what kind of version bump I needed for the latest release, and missed that this caused a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honest oversight :) IMO we should revert this change upstream (or revert, retag, intro as a major change). It's starting to cause issues to be filed on projects elsewhere (Polymer CLI etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sw-toolbox could be changed to copy the build back to the root of the project for the release. This is the result of not having the built sw-toolbox in the master branch.
This is great! |
Regarding the point about caches.match... could the parameters be stored on the Response instead? So, construct the modified URL, fetch that, and I guess it makes it harder to look this stuff up... |
That's an interesting idea re: using
Any thoughts on those? |
LGTM. My only real comment was to do with the toolbox dep. Everything else appears in order here. |
I'm going to go ahead with the strategy of using a custom search param in the |
R: @addyosmani @gauntface @wibblymat
I think I'm happier with the code using this approach, as it also simplifies some of the logic by using
Map
andSet
, neither of which were widely available when the code was originally written.The one drawback that I can see is that it's no longer possible to use
caches.match()
to pick up a givenResponse
from arbitrary code that the user writes, since theRequest
objects used as cache keys now have URL parameters appended to them. That's not an advertised use case, though, so I'm not worried.This will be part of a forthcoming 4.0 release, so I'm not ready to update the
package.json
metadata yet.Closes #86