Releasing Stout, our Static Website Deploy Tool

Stout static deploy tool terminal screenshot

At Eager, we believe in the power of static sites. If you’re not familiar, static sites are websites which are served (usually through a CDN) from a static file store like Amazon’s S3. When a request comes in, there are no database connections to make, no scripts to run, no files to minify. Instead of doing all your building and minification on every request, you do it once, and upload the result to S3. Compared to dynamic sites, static sites scale painlessly, are much less likely to break in the middle of the night, and can be significantly faster.

“Caching meant that for users could temporarily get a new copy of one JavaScript file, and an old copy of another.”

Unfortunately, we weren’t able to find a great open-source way to do the actual uploading of our built files to S3. Obvious solutions which push your local directory to S3 had major issues. A failure halfway through a deploy would leave inconsistent state. More importantly, caching meant that for users could temporarily get a new copy of one JavaScript file, and an old copy of another, leading to mysterious transient errors with every deploy.

So we built our own tool, called Stout, to solve these problems. Stout parses your HTML files to find the JavaScript and CSS they point to. It uploads those files with a hash of their contents included in their URL, and updates the HTML to point to those versioned files. Only after every dependency is safely uploaded does it atomically swap the versioned HTML file for the unprefixed one which is then served.

Stout supports real caching. It allows you to instantly rollback to any previous deploy. It is also not dependent on any specific build tool. Finally, it doesn’t require any sort of datastore, and is safe for multiple developers to use simultaneously.

We use it every day to deploy our app, this blog, and every other part of our static infrastructure. We invite you to take a look, and let us know what you think.

Improve your website with free tools you can install in seconds.

Get Eager

Like this post? Share it with your followers.

Sign up to get our next post delivered to your inbox.

Follow us to get our latest updates.