DynoSRC - Eliminate HTTP requests for JavaScript files
dinosrc.it
dinosrc.it
He talks about it here → http://www.youtube.com/watch?v=E9FxNzv1Tr8#t=600
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.
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.
The packaging and minification can be handled either as a filter at the server level or during the build and deploy if your stack supports that metaphor. These have been the common practices in my experience.
Most with absolutely zero data to back up that it provides any sort of useful improvements to justify the difficulties it introduces in debugging.
Considering how almost all web-servers and browsers support HTTP compression, minification is mostly a cargo-cult ritual.
A quick google search got me to SO: http://stackoverflow.com/a/807161 results seem pretty significant. Besides, the worse your connection is, the more you will appreciate these techniques.
jquery-2.0.3.js 236K
jquery-2.0.3.js.gz 70K
jquery-2.0.3.min.js 82K
jquery-2.0.3.min.js.gz 29K
Minification pay off a lot even with compression. time curl http://code.jquery.com/jquery-2.0.3.js > /dev/null
real 0m0.433s
time curl http://code.jquery.com/jquery-2.0.3.min.js > /dev/null
real 0m0.210s
Is it proved now ?Edit: Off course I didn't ran these requests only once.
time curl http://code.jquery.com/jquery-2.0.3.js > /dev/null
236k bytes
real 0m0.432s
time curl http://code.jquery.com/jquery-2.0.3.min.js > /dev/null
83612 bytes
real 0m0.323s
time curl http://code.jquery.com/jquery-2.0.3.js --compressed > /dev/null
87509 bytes
real 0m0.273s
time curl http://code.jquery.com/jquery-2.0.3.min.js --compressed > /dev/null
34066 bytes
real 0m0.215s
I think that people should be more skeptical of the complexity introduced by things like minification, but the advantages are pretty clear, even with compression.While it depends on a lot of factors, generally speaking minification is a good thing especially for mobile. There's really no downside in doing it (see next point).
> justify the difficulties it introduces in debugging
What difficulties? You should use a build process that minifies for your production site but not for testing. If you need to debug the live, minified files you can use source maps[1].
1: http://www.html5rocks.com/en/tutorials/developertools/source...
BTW, how does differential updates do under minification? Don't the differences usually end up replacing the entire functions?
Don't minify. Minifying is a kludge. This (and gzip) actually looks like a properly engineered solution.
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.
The Tragedy of the RProxy: http://ozlabs.org/~rusty/rproxy.html
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.
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 ! :-)