shawnbot / TODO

Somebody hold me accountable to this stuff.
0 stars 0 forks source link

A web optimization proxy #19

Open shawnbot opened 7 years ago

shawnbot commented 7 years ago

This would be cool: a web proxy that you could put in front of an existing site and optimize various aspects without having to modify the source:

  1. CSS could be processed with postcss and autoprefixer, concatenated, and minified.
  2. JavaScript could be processed with autopolyfiller, concatenated, and minified.
  3. HTML documents could be linted and reformatted, and external JS and CSS could be "bundled" by rewriting sequences of external references as a single URL that does the concatenation.
    • The only snag here would be to avoid bundling external scripts that are interspersed with inline ones, since that could cause problems with execution order (unless explicitly marked as async).
    • This could even do critical CSS with some magic under the hood.
    • Other programmatic HTML transformations (e.g. with postHTML) could add accessibility features to sites based on common selector patterns, and automatically include scripts that enable a11y behaviors.
  4. Raster images and SVG images could be optimized.