
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 Path | Size (Bytes) | Role in Site |
|---|---|---|
index.html | 2,118 | Root landing page |
about.html | 2,087 | Top-level page with extension |
docs/index.html | 2,060 | Subfolder index page |
404.html | 2,333 | Custom error page |
assets/site.98c0211e.css | 7,036 | Content-hashed stylesheet |
assets/app.a8bc0ca9.js | 4,786 | Content-hashed JavaScript bundle |
data/feed.json | 893 | Dynamic data endpoint |
assets/font.woff2 | 260 | Web font asset |
assets/logo.svg | 140 | Brand SVG graphic |
site.webmanifest | 63 | PWA application manifest |
robots.txt | 56 | Search crawler rules |
assets/hero.webp | 34 | Modern WebP image |
assets/calc.wasm | 8 | WebAssembly 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.
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 Path | Status | Content-Type | Bytes | Observed Bucket Behavior |
|---|---|---|---|---|
/ | 200 OK | text/html; charset=utf-8 | 2,118 | Resolves automatically to index.html |
/index.html | 200 OK | text/html; charset=utf-8 | 2,118 | Direct object match |
/docs/ | 200 OK | text/html; charset=utf-8 | 2,060 | Resolves automatically to docs/index.html |
/docs | 404 Not Found | text/plain; charset=utf-8 | 10 | Fails: No automatic trailing slash redirect |
/about.html | 200 OK | text/html; charset=utf-8 | 2,087 | Direct object match |
/about | 404 Not Found | text/plain; charset=utf-8 | 10 | Fails: No extensionless HTML fallback |
/missing | 404 Not Found | text/plain; charset=utf-8 | 10 | Returns raw "Not found", not 404.html |
/assets/ | 404 Not Found | text/plain; charset=utf-8 | 10 | No directory listing |
/Docs/ | 404 Not Found | text/plain; charset=utf-8 | 10 | Case-sensitive; uppercase fails |
/?utm_source=test | 200 OK | text/html; charset=utf-8 | 2,118 | Query parameters ignored; serves root |
http://.../ | 301 Moved | text/html; charset=UTF-8 | 167 | Redirects to HTTPS |
Three critical operational details emerged from these tests:
- 1. Trailing slashes are mandatory for subfolders:
/docs/succeeds because the gateway looks fordocs/index.htmlwhen a trailing slash is present. But/docs(without slash) returns404 Not Found. The bucket does not automatically redirect slashless folder requests to slash URLs. - 2. No clean URLs without extensions: Requesting
/aboutfails with a 404. The bucket looks for an exact object key namedabout. If your static site generator generatesabout.htmlinstead ofabout/index.html, visitors who omit.htmlwill see an error. - 3. The custom 404 trap: Having a
404.htmlin your bucket does not make the bucket serve it on errors. Requesting/404.htmldirectly returns a 200 with your styled error page. But requesting/missingreturns 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:
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:
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-Matchwith the file's ETag returned304 Not Modifiedwith 0 body bytes in 76 ms (compared to 904 ms for a full 200 download). SendingIf-Modified-Sincewith the Last-Modified timestamp returned an identical 304. - Brotli compression: Requesting files with
Accept-Encoding: gzip, brresulted 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-99on the CSS file returned206 Partial Contentwith exactly the first 100 bytes and headerContent-Range: bytes 0-99/7036. Out-of-bounds ranges returned416 Range Not Satisfiable. - Method restrictions:
POST,PUT,DELETE, andPATCHrequests were rejected with405 Method Not AllowedandAllow: GET, HEAD.OPTIONSreturned204 No ContentwithAccess-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 Path | Cache-Control Header | Time to See New Version | Result Over 330 Seconds |
|---|---|---|---|
/index.html | no-cache | 2.1 s | Updated on the first poll check |
/data/feed.json | public, max-age=300 | 4.5 s | Updated at the edge within 5 seconds |
/assets/logo.svg | public, max-age=31536000, immutable | Never (> 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.htmlrather thanabout.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-cacheso 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><bucket>-<slug>.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.spaceSources and testing setup
- Tested live 8 November 2026 using
rclone v1.75.2andcurl 8.5.0against a public S3 bucket ons3.tport.space - IETF, RFC 9110: HTTP Semantics (Conditional Requests and Status Codes)
- IETF, RFC 9111: HTTP Caching and RFC 8246: Cache-Control Immutable
- rclone documentation, Global Flags and Header Uploads
- tport.space, Public files guide and S3 tools setup