Sunday 2014-12-14

Current web dev can result in a slew of CSS, javascript, and icon files being loaded for a single page, needlessly slowing down that page's load time.

Reducing a pageview to a single GET may not be easily attainable, depending on the site's production environment, E.g. for this blog, it was easy to embed the JS and CSS files, while the image files needed to be converted to base64 first. The dynamically generated list of articles and article repository remain individual XRHs, though.

Simple tech can be used to assemble the pieces, such as the M4 preprocessor:

default: index.js index.m4 index.css main.css
	m4 -P index.m4 > index.html

prod: default
	scp index.html

A nice side effect of this is that the previously external thumbnails for books and movies are now localized to their review page, and won't ever be lost.