Form Rig

Best Practices
Deploy Assets Before Documents

Eric Fortis

Unstyled pages. Not all of them are FOUCs. Some happen while deploying due to temporary 404s of images, CSS, or JS.

Form Rig avoids those issues by nesting assets in subdirectories:

  • index.html
  • static/foo.js
  • images/bar.jpg

…and deploying them in two steps:

# Subdirectories first
rsync -r --include '*/' --exclude '/*' $SRC/ $DEST/

# Then the top level files (HTML documents)
rsync --times $SRC/* $DEST

Sponsored by: