Fastly Compute Static Publish v8 Adds Object Storage, Collections and Faster Updates
Version 8 separates site files from the Compute app, adds S3 storage and preview collections, and speeds publishing with parallel compression and batching.

Fastly’s version 8 of @fastly/compute-js-static-publish changes how static sites are stored and updated on Compute. The generated JavaScript app serves files from Fastly KV Store by default, with a beta option for Fastly Object Storage or other S3-compatible storage. That separation means content updates no longer require rebuilding and deploying the application, and collections let teams publish and switch between multiple site versions.

Get a site running without writing app code
The tool takes a directory of static files and scaffolds a Fastly Compute application. For a folder named public, run:
npx @fastly/compute-js-static-publish@latest \
--root-dir=./public \
--kv-store-name=site-contentThis creates the app in compute-js. With Node.js 20.11 or newer and the Fastly CLI installed, you can install dependencies and run it locally:
cd compute-js
npm install
npm run dev:publish
npm run dev:startThe local server makes the site available at http://127.0.0.1:7676, using a simulated KV Store. Trying this locally doesn't require a Fastly account or service. To deploy, set the FASTLY_API_TOKEN environment variable, then run npm run fastly:deploy followed by npm run fastly:publish. The first command deploys the app and creates its KV Store; the second uploads the site files.
Content lives outside the application
Earlier versions bundled files into a single WebAssembly binary. That kept deployment straightforward, but tied site size to the app package limit and required a new build and deployment for each content change. Version 4 introduced KV Store as an alternative. Version 7 removed inline file bundling, making KV Store the current default.
In KV Store, files are stored under keys derived from their content hashes, so identical files can be reused across publishes. Files larger than 20 MB are split into chunks and reassembled when requested. Since the site content isn't packaged into the app, the package size limit no longer caps the total size of the site. Content-only updates also avoid a new app deployment; redeployments are needed when application code or configuration changes.
Version 8 adds a second storage option: Fastly Object Storage and other S3-compatible services. Files stay intact there, including those larger than 20 MB, and the company says its Object Storage costs tend to be lower than KV Store costs. Rates depend on current pricing. Object Storage support is in beta, while KV Store remains the default. Teams considering the S3 option can find credential setup instructions in the project repository.
Publish previews alongside the live site
Separating content from app code also makes it practical to keep several site versions available at once. A collection is a named group of files and the server settings associated with them. For example, a team could keep live, staging, and individual pull request previews side by side.
A staging collection that should expire after a week can be published with:
npx @fastly/compute-js-static-publish publish-content \
--collection-name=staging \
--expires-in=7dWhen it's ready to serve as the live version, switch the collection with:
npx @fastly/compute-js-static-publish collections promote \
--collection-name=staging \
--to=liveExpired collections stop being served, and the clean command removes files that no remaining collection uses. The app can select a collection on each request using a hostname, cookie, header, URL path, or value from a Fastly Config Store. That gives teams a way to route preview traffic separately while maintaining a live collection.
Faster publishing and optional response caching
Compression happens during publishing. By default, text files are stored in Brotli and gzip forms alongside the original, and the server chooses the smallest version the visitor’s browser supports. It also handles conditional requests, returning 304 Not Modified when a client already has the current file.
Version 8 speeds up publishing by reducing the time spent checking existing storage, skipping unchanged files, scanning and compressing files in parallel, and batching uploads to KV Store or Object Storage. Teams can lower Brotli quality in the publish configuration to compress faster at the cost of somewhat larger files.
An optional response cache can reduce storage reads for repeat requests. Enable it with setResponseCache(); it uses Compute’s Core Cache API to cache whole responses. By default, responses larger than 8 MiB bypass that cache and are served from storage, though maxBodySize can raise the threshold. Publishing new content automatically purges the cache for the affected collection. Both response caching and the Server-Timing header option are off by default. The header, enabled through setServerTimingRequestHeader(), reports timing details such as whether the response cache hit or missed.
The generated app remains open to customization
For teams that only need file serving, the scaffolded app works without custom code. It is still a regular JavaScript application, so request handling can be extended when the site needs more than static responses.
The central PublisherServer class maps requests to published files and handles index files, 404 pages, single-page app fallbacks, compression, and caching headers. If it can't serve a request, it returns null, leaving the app to handle that path itself. For example, custom code can add an API endpoint:
import { PublisherServer } from '@fastly/compute-js-static-publish';
import rc from '../static-publish.rc.js';
const publisherServer = PublisherServer.fromStaticPublishRc(rc);
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const response = await publisherServer.serveRequest(request);
if (response) {
return response;
}
const url = new URL(request.url);
if (url.pathname === '/api/hello') {
return new Response(JSON.stringify({ greeting: 'hi' }), {
headers: { 'content-type': 'application/json' },
});
}
return new Response('Not Found', { status: 404 });
}The same app can add authentication, redirects, A/B testing, or collection selection. For code that needs to inspect files directly, getMatchingAsset() provides file bytes or metadata such as content type, size, and hash. This is the main practical shift from older versions that exposed file contents through an assets object: the server now provides the request-serving interface, while custom code can still retrieve assets as needed.
Tooling, local workflows and migration
The command line has grown from a single command into a set of subcommands: publish-content, clean, and collections, which includes list, promote, delete, and update-expiration. Commands that change state support --dry-run, so teams can inspect planned changes before applying them.
After publish-content or collections delete, the tool soft-purges the affected collection’s surrogate key. The --fastly-service-id and --purge-environment options control which service and environment are targeted.
KV Store workflows can run locally with the --local flag and a simulated store. Object Storage has no local simulation, but the local development server can read files from a bucket after they have been published there. Using a separate bucket or collection for development helps keep those changes away from the content served in production. Configuration also supports file inclusion and exclusion, content type overrides, choices of compression variants, and per-collection settings such as SPA fallbacks and custom 404 pages.
Upgrades depend on the version in use. Users of version 6 or earlier need to scaffold the app again because version 7 was a major rewrite that removed inline Wasm files and module asset support. The version 6 branch remains available for projects that depend on module assets.
Version 7 users already storing content in KV Store don't need to re-scaffold. They can install version 8 in the existing compute-js directory, rebuild, and deploy; existing published content continues to be served. One deployment detail changes: the tool now requires an API token through FASTLY_API_TOKEN or --fastly-api-token, and no longer uses credentials from a Fastly CLI login as a fallback. The migration guide covers other changes.
Version 8’s value is clearest for teams that publish often or need separate preview environments: content can change independently of the app, and storage and caching options offer room to tune the workflow. Object Storage remains in beta, so teams weighing that backend should check the project documentation and current pricing before building around it. The package is available on npm, with documentation and configuration details in the GitHub repository.