Is it possible to port JavaScript and CSS as binaries from server to client?
I am new to web development.
I see JavaScript and CSS minification is widely used to speed up web page load times. But no doubt the data in text format will be longer than binary format, so why are we still using textual JavaScript and CSS?
Is it possible in the future to use a binary format for servers to provide descriptive and behavioral definitions?
I think that if there is a common standard for delivering this data as binary data, then server-side programs will be created to convert the JS / CSS text format created by web designers to binary format and network traffic will be significantly reduced.
Can someone give me some ideas about this?
source to share
Gzip is quite widely used http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
source to share
Interestingly, you didn't mention the binary version of HTML in your question.
A year ago, the W3C published EXI , a specification for binary XML. You can use XML to represent HTML documents, so it is already possible to represent HTML in binary as standard (however browsers have not yet supported this).
CSS is a very common format, so creating a binary format for it would be tricky. (You may be interested in this.) On the other hand, there will be standardization of this format.
Perhaps in the future people will write all their code in abstraction languages like SLIM and SASS , which will then be compiled into binary XML, allowing browsers to use one very fast and efficient interface for parsing markup and style.
As others have noted, little attention has been paid to developing web standards for more efficient data transfer. The consensus at the moment is that binary formats will complicate things (it will no longer be possible to edit data directly), will not reduce the size much more than gzip *, and that further size reduction is not required, especially since the introduction of a fiber optic system.
* gzip is a versatile compression program, much more widely used than any domain-specific binary format, and therefore much more thoroughly tested and supported.
source to share