6 ms·
DynoSRC - Eliminate HTTP requests for JavaScript files
- wyuenho 13y agoI see the repo the Github Docs points to is a fork of https://github.com/DynoSRC/dynosrc https://github.com/DynoSRC/dynosrc, which one is actually the canonical repo? BTW, how does differential updates do under minification? Don't the differences usually end up replacing the entire functions?
- lloeki 13y ago> BTW, how does differential updates do under minification Don't minify. Minifying is a kludge. This (and gzip) actually looks like a properly engineered solution.
- asdfaoeu 13y agoAre there any benchmarks? I have a hard time seeing this make any significant improvement over minified concatenated javascript files. And are you really updating your javascript files enough thats it's a problem?
- getdavidhiggins 13y agoIlya Grigorik talks about how the Gmail devs keep all their JS modular, so that when a change really needs to be made on the live web-app; only one small file needs to be affected. Another huge JS file does not need to be sent down the wire. If you modify a massive file, you inadvertently DDOS your own server. He talks about it here → http://www.youtube.com/watch?v=E9FxNzv1Tr8#t=600 http://www.youtube.com/watch?v=E9FxNzv1Tr8#t=600
- dsr12 13y agoHow well will "Differential Updates" work for minified files?
- talles 13y agoGood question, definitely needed to know before using.
- tlarkworthy 13y agoBe nice if it did something about images too
- stereo 13y agoAnd CSS, of course. Cram the entire page in a single HTTP request.
- afandian 13y agoMy first instinct is "how bad is the motivating problem, really?". How often do you have a single massive JS file where a small number of lines change? I'm not saying it's a bad idea, but starting with a case study would be nice rather than jumping in with "we've completely changed everything about how script files are delivered, it's amazing and we have cool graphics to prove it". The dinosaur looks a bit hand-wavy. There are a lot more moving parts, a lost more surface area for things to go wrong, etc. Yes, downloading huge JS files is a problem, but you're going to have to download them one way or another.
- bilalq 13y agoI imagine its probably fairly common. Lots of sites will minify and concatenate their JS, after all.
- geon 13y agoWouldn't that screw up the diff as well?
- borplk 13y agoNot an expert on this, but could something like rsync be implemented and allow it to treat the file as binary? (e.g. minified or non-minified doesn't matter)
- afandian 13y agoIf the minifcation involves symbol substitution, the substitutions are going to depend on the content of the whole file. So unless you re-implement the minification algorithm to be optimised for minimising diffs you might find that every variable's name has changed and size of the file diff might start to approach (or exceed) the size of the file itself.
- michaelmior 13y agoAgreed this is a problem. Although perhaps it's worth not minifying your JS to gain the speedup from the use of diffs?
- alien3d 13y agoSorry,i'm quite confuse.i reloading the page .seem request for js file still exist ? Shouldn't browser cache javascript file normally upon second time refreshing web page.
- prottmann 13y agoYes the browsers do it. But this is in case you have a bigger JS-File (e.g. for a Web-App) and your customer visit again, so you only have to transfer a small peace of data. But iam not sure if the performance / traffic advantage is so high, that dyno justify the effort. And you have one more source of possible error, so i did not think many developer will use it. The idea is good, but the solution should work automatically in background on the transportation layer, between browser and server, not for app developer. @Jason Anderson: Call google - chrome developer if they implement it in their Browser and write an apache Plugin ! :-)
- Kiro 13y ago> Eliminate HTTP requests for JavaScript files Great! We already do this manually for mobile sites so I will definitely try it out. > and serve differential updates I didn't understand this part.
- arkitaip 13y agoDifferential updates means that only line changes in your javascript will have to be downloaded instead of downloading entire files.
- bungle 13y agoWhat does this mean to local storage requirements if every site does this?
- cedias 13y agoisn't that what's browser cache is for ?
- k__ 13y agomabye they use the localstorage for incremental updates
- gulbrandr 13y agoThis only works with Git, right? https://github.com/DynoSRC/dynosrc#how-does-it-work https://github.com/DynoSRC/dynosrc#how-does-it-work
- michaelmior 13y agoThis seems like it would really complicate use of a CDN given that page content is now different based on what users have cached. You could look at cookie values and still get some caching, but this would hurt your cache hit rate. It also bars you from using a lot of the cheaper CDNs which won't let you inspect the request deeply enough to efficiently cached based on the cookie. So if you can't use a CDN or your cache hit rates are much lower, you might end up with slower page loads with technique. But of course I have no data to back this up.
- viraptor 13y agoThis really looks like the wrong layer to do that... It could be interesting to extend HTTP / etag to do something similar globally. Instead of "tell me nothing changed, or send a new version", browser could request "tell me nothing changed, or send a patch from version XXX".
- samworm 13y agoI agree the "send me differences" model is appealing. A version based off rsync was created back in 1999 but patents killed it. I think the patent in question runs out pretty soon though... The Tragedy of the RProxy: http://ozlabs.org/~rusty/rproxy.html http://ozlabs.org/~rusty/rproxy.html