Laptop displaying web source code in a text editor for a static site

Object storage is cheap, fast, and simple for hosting static sites. You push HTML, CSS, and JS into a public bucket, and visitors download files directly over HTTPS without maintaining web server software.

However, object storage is a key-value store, not Nginx or Apache. Path resolution, trailing slashes, 404 error routing, and cache revalidation do not work like a conventional web server. If you assume default web server rules apply, visitors will hit unexpected 404 errors and stale cached assets.

To find out exactly how a bucket behaves as a website host, we built a 13-file static site fixture, uploaded it with rclone v1.75.2, and ran 64 live HTTP checks using curl 8.5.0. Here is what works, what fails, and how to avoid deployment traps.

The 13-file test fixture and 3-step rclone deploy

Our test fixture totaled 23,280 bytes across 13 files, covering the standard asset types of a modern web application: HTML pages, hashed scripts, stylesheets, fonts, icons, web manifests, JSON feeds, and WebAssembly.

File PathSize (Bytes)Role in Site
index.html2,118Root landing page
about.html2,087Top-level page with extension
docs/index.html2,060Subfolder index page
404.html2,333Custom error page
assets/site.98c0211e.css7,036Content-hashed stylesheet
assets/app.a8bc0ca9.js4,786Content-hashed JavaScript bundle
data/feed.json893Dynamic data endpoint
assets/font.woff2260Web font asset
assets/logo.svg140Brand SVG graphic
site.webmanifest63PWA application manifest
robots.txt56Search crawler rules
assets/hero.webp34Modern WebP image
assets/calc.wasm8WebAssembly module

Uploading a static site in a single command is a mistake. Different file types need completely different caching policies, and uploading HTML files before their dependent assets are live can cause visitors to download a new page that requests missing chunks.

We deployed the site in three distinct rclone passes:

  • Pass 1: Static assets with 1-year immutable caching. Bundles with content hashes in their filename never change. Set max-age=31536000, immutable.
  • Pass 2: Revalidating feeds and manifests. JSON data and manifests should revalidate after 5 minutes. Set public, max-age=300.
  • Pass 3: HTML entry points last. HTML files must always revalidate so users discover new deployments immediately. Set no-cache.
bash
# 1. Immutable assets first (6 files, 13 S3 operations, 7.7 s)
rclone copy ./site tport:my-site-bucket \
  --include "/assets/**" \
  --header-upload "Cache-Control: public, max-age=31536000, immutable"

# 2. Metadata and feeds (3 files, 7 S3 operations, 4.9 s)
rclone copy ./site tport:my-site-bucket \
  --exclude "*.html" \
  --exclude "/assets/**" \
  --header-upload "Cache-Control: public, max-age=300"

# 3. HTML pages last (4 files, 9 S3 operations, 5.7 s)
rclone copy ./site tport:my-site-bucket \
  --include "*.html" \
  --header-upload "Cache-Control: no-cache"

In our test, rclone took exactly 2 S3 API requests per uploaded file: one PutObject to upload the data, and one HeadObject to verify size, ETag, and metadata headers. Each pass also made one initial ListObjects call.

Routing behavior: index pages, slashless paths, and the 404 surprise

Once files were uploaded, we probed the live endpoint with curl to observe URL resolution, HTTP status codes, headers, and body responses.

Request PathStatusContent-TypeBytesObserved Bucket Behavior
/200 OKtext/html; charset=utf-82,118Resolves automatically to index.html
/index.html200 OKtext/html; charset=utf-82,118Direct object match
/docs/200 OKtext/html; charset=utf-82,060Resolves automatically to docs/index.html
/docs404 Not Foundtext/plain; charset=utf-810Fails: No automatic trailing slash redirect
/about.html200 OKtext/html; charset=utf-82,087Direct object match
/about404 Not Foundtext/plain; charset=utf-810Fails: No extensionless HTML fallback
/missing404 Not Foundtext/plain; charset=utf-810Returns raw "Not found", not 404.html
/assets/404 Not Foundtext/plain; charset=utf-810No directory listing
/Docs/404 Not Foundtext/plain; charset=utf-810Case-sensitive; uppercase fails
/?utm_source=test200 OKtext/html; charset=utf-82,118Query parameters ignored; serves root
http://.../301 Movedtext/html; charset=UTF-8167Redirects to HTTPS

Three critical operational details emerged from these tests:

  • 1. Trailing slashes are mandatory for subfolders: /docs/ succeeds because the gateway looks for docs/index.html when a trailing slash is present. But /docs (without slash) returns 404 Not Found. The bucket does not automatically redirect slashless folder requests to slash URLs.
  • 2. No clean URLs without extensions: Requesting /about fails with a 404. The bucket looks for an exact object key named about. If your static site generator generates about.html instead of about/index.html, visitors who omit .html will see an error.
  • 3. The custom 404 trap: Having a 404.html in your bucket does not make the bucket serve it on errors. Requesting /404.html directly returns a 200 with your styled error page. But requesting /missing returns a bare 10-byte plaintext string: Not found. Object storage does not intercept 404 errors to serve custom HTML.

The slashless folder fix and the rclone sync trap

Users frequently type URLs without a trailing slash (e.g. example.com/docs). Since object storage buckets will not issue an automatic 301 redirect to /docs/, how can you prevent a 404?

We tested uploading an extensionless copy of docs/index.html directly to the key docs:

bash
rclone copyto ./site/docs/index.html tport:my-site-bucket/docs \
  --header-upload "Cache-Control: no-cache"

When we re-tested curl -i https://my-site-bucket.tport.space/docs, the request answered with HTTP/2 200 OK and returned all 2,060 bytes of the documentation page. Both /docs and /docs/ now return the page.

However, this creates a dangerous trap with rclone sync. When we ran a dry-run sync:

bash
$ rclone sync ./site tport:my-site-bucket --dry-run
NOTICE: docs: Skipped delete as --dry-run is set (size 2.012Ki)
INFO  : There was nothing to transfer

Because docs is an extensionless object that does not exist in your local ./site directory, rclone sync treats it as a deleted file and removes it on every sync! If you use this extensionless workaround, either deploy with rclone copy or explicitly exclude the synthetic keys using --exclude "/docs".

Caching in action: ETags, compression, and what happens when files change

A static site bucket should support conditional revalidation, byte-range streaming, and modern transport compression.

  • Conditional GETs (304 Not Modified): Sending If-None-Match with the file's ETag returned 304 Not Modified with 0 body bytes in 76 ms (compared to 904 ms for a full 200 download). Sending If-Modified-Since with the Last-Modified timestamp returned an identical 304.
  • Brotli compression: Requesting files with Accept-Encoding: gzip, br resulted in Brotli encoding (content-encoding: br). HTML shrank from 2,118 to 290 bytes; CSS shrank from 7,036 to 1,390 bytes; JS shrank from 4,786 to 669 bytes; JSON shrank from 893 to 128 bytes.
  • Byte-range reads (206 Partial Content): Requesting Range: bytes=0-99 on the CSS file returned 206 Partial Content with exactly the first 100 bytes and header Content-Range: bytes 0-99/7036. Out-of-bounds ranges returned 416 Range Not Satisfiable.
  • Method restrictions: POST, PUT, DELETE, and PATCH requests were rejected with 405 Method Not Allowed and Allow: GET, HEAD. OPTIONS returned 204 No Content with Access-Control-Allow-Origin: *.

The file replacement test: how long do old files linger?

To measure cache invalidation latency, we uploaded modified versions of three files and polled the public URLs every 10 seconds for 330 seconds.

File PathCache-Control HeaderTime to See New VersionResult Over 330 Seconds
/index.htmlno-cache2.1 sUpdated on the first poll check
/data/feed.jsonpublic, max-age=3004.5 sUpdated at the edge within 5 seconds
/assets/logo.svgpublic, max-age=31536000, immutableNever (> 330 s)Served old file for all 29 checks

The lesson is clear: files marked with immutable will never refresh in browser or edge caches when replaced in-place at the same URL. You must use content hashes in asset filenames (e.g. logo.3a7b9c.svg or site.98c0211e.css). Reserve in-place replacements for files with no-cache or short revalidation windows.

Summary checklist for hosting static sites from a bucket

When hosting a static website on an S3-compatible public bucket, follow these four rules:

  • Always link with trailing slashes: In internal navigation and sitemaps, link to /docs/, not /docs. Without a trailing slash, visitors get an unhandled 404.
  • Build directory-style HTML: Configure your static site generator (Hugo, Astro, Next.js static export) to output /about/index.html rather than about.html, so clean URLs resolve.
  • Deploy assets first, HTML last: Upload hashed assets with 1-year immutable caching first, then push HTML files with no-cache so visitors never fetch broken dependencies.
  • Use content hashing on all assets: Never replace immutable assets in-place. Caches will hold the old bytes indefinitely.

Public buckets answer on generated hostnames like <code>&lt;bucket&gt;-&lt;slug&gt;.tport.space</code> over HTTPS. If your project requires custom apex or vanity domains with custom 404 page interception, place a CDN or reverse proxy in front of the bucket endpoint.

For more on S3 transfer workflows, see our benchmarks on rclone sync vs copy deletion behavior, cache headers and image request savings, and backing up a website with rclone.

Host public web assets and static files from S3-compatible object storage with no egress fees.

Explore tport.space

Sources and testing setup