Using incremental publishing

When you publish, the Surge command line tool compresses and streams the entire content of your project to us, all without writing any files to disk. Once the files are uploaded to our initial staging server, they are sent to a CDN fleet. This step is incremental; files that are unchanged and don’t need to be propigated, won’t be.

The first step, upload, will happen in its entirety each time you deploy. Step two will only take place on files that have changed since the last time you published.

Before introducing Surge, we looked into making the first upload step incremental as well. It added significat complexity, and we didn’t want to delay launching at the time. Additionally, only larger projects would be dramatically impacted by this work. Right now, only this second propigation stage is incremental.

This has the added benefit of ensuring that, each time you publish, you can feel confident knowing the files you have changed locally will be uploaded.

We’re open to adding incremental upload support in the future. Feel free to follow along with this issue on GitHub. In the meantime, if you’d like to make the entire publishing step happen in the background, you can also generate a token and run Surge on a continuous deployment system like Travis CI, CircleCI, or Codeship.