Multiple images can be put into a single image file and then referenced via CSS individually.
This reduces GET requests.
Does anyone do anything similar for html, javascript, and CSS files, i.e. text files?
Basically put them in one static file in the server, sent to the client as 1 Get request, and then is parsed into separate files for insertion into the DOM
This would reduce multiple GET requests, similar to Sprites.
It is sometimes done. The Dojo Toolkit, for example, includes functionality to create a custom build via a small Java utility which gathers all the needed JavaScript components, and combines & compresses them into a single file. It likewise copies all included CSS into a single file and brings inline any
@importcalls.Beyond advanced functionality like Dojo’s there’s nothing stopping you from simply dumping all your CSS into the
<head><style/></head>and your scripts into<head><script/></head>. It is not considered a best practice, however, as it can impede code reuse unless you have configured a CMS to do the insertion and style in-lining for you (like Dojo does for JS and associated components).