pinocchio
pinocchio

Reputation: 71

Feasibility of transporting JavaScript and CSS as binary from server to client?

I am a newbie in the web development field.

I see that minification of JavaScript and CSS is widely used to reduce web-page load times. But, undoubtedly, text format data will be longer than binary format, so why do we still use textual JavaScript and CSS?

Is it possible in the future to use binary format for servers to deliver presentational and behavioral definitions?

I think if there is a common standard to deliver these as binary data, then server-side programs will be created to convert text format JS/CSS produced by web designers to binary format, and network traffic will be greatly reduced.

Can anybody give me some ideas about this?

Upvotes: 5

Views: 1096

Answers (3)

Zaz
Zaz

Reputation: 48799

It's interesting that you didn't mention a binary version of HTML in your question.

A year ago, W3C published EXI, a specification for binary XML. You can use XML to represent HTML documets, so it is already possible to represent HTML in binary in a standards-compliant way (however, browsers have yet to support this).

CSS is a very regular format, so creating a binary format for it wouldn't be hard. (You might be interested in this.) Standardizing that format, on the other hand, would be.

Maybe in the future, people will write all their code in abstraction languages like SLIM and SASS, which will then be compiled to binary XML, allowing browsers to use one very fast and efficient interface to parse both markup and style.


As others have pointed out, little effort is being spent on 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 the data directly), won't reduce the size much more than gzip*, and that further reduction in size is not necessary, especially since the introduction of fibre-optic.

* gzip is a general-purpose compression program much more widely used than any domain-specific binary format, and so is much more thouroughly tested and supported.

Upvotes: 0

user207421
user207421

Reputation: 311008

The feasibility is nil. It would require the existence of a universal standard for binary JavaScript and CSS, understood by all browsers, and by a lot of technology that is peripherally concerned with both.

There isn't one.

Upvotes: 3

Related Questions