Closed kdoh closed 9 years ago
Yeah, that's pretty close to what I originally had in mind. I would actually prefer it if the hash was part of the filename though, it's a little strange to have a ?<hash>
appended onto the file.
So I was thinking something more like vendor.<hash>.js
and app.<hash>.js
The rest of the approach looks sensible to me. Its not loading the css for me, but everything else looks good.
The advantage of doing ?<hash>
is that you don't end up with a zillion extra files, but I guess that's only really an issue for development (which we could add a special case for, like stripping the .min
s)
got it. the main thing that makes me itchy is having urls like /vendor.js?<hash>
where the filename of the asset includes the query string. that just feels wrong.
obviously one other alternative could be to just use random hashes in the index.html but don't change anything about the way the bundles are created. that would also bust the cache correct? the main thing being that the url used in the browser is changing regularly.
in any case. lets just focus on a solution that works for right now so that we can ship it today. we can make the solution more elegant down the road.
@agilliland To clarify, Webpack is smart enough to not actually include the query string in the filename on disk, only in the URL in the HTML, which I think is what I think you mean by "just use random hashes in the index.html but don't change anything about the way the bundles are created".
And yes it will still bust the cache even though the filename on disk doesn't change (the browser doesn't know that)
I was surprised by that since the parameter is called "filename", but I think it's what we want.
Need a way to bust stale caches when assets change.