Static Website Serving
Aerobatic is a specialized platform for efficient delivery of static webpages and website assets. We take care of the configuration details for you that provide the best balance of performance and maintainability. Stop fiddling with CDNs and web server configs and focus on coding great front-end experiences.
When a visitor hits the base URL for your website like
https://custom-domain.com, Aerobatic looks for a
index.html file at the root of your deployment directory. Requests for nested paths (
/blog/article-name) are translated to a
.html file at the same location in the folder hierarchy. So
If you've ever configured a web server you'll know that trailing slashes can pose a challenge. Standard web server behavior for a request to
/blog/ (with trailing slash) is to look for a file at
/blog/index.html. But what happens if the trailing slash is omitted in the request? Many web servers will just return a
404. Aerobatic has intelligent fallback detection that will
301 redirect if there exists an alternative page. So a request for
https://site.com/blog will automatically redirect to the trailing slash version
https://site.com/blog/ if (and only if) the file
/blog/index.html exists. The inverse is true for trailing slash to non-trailing slash. This helps reduce
404 errors for common URL permutations.
Aerobatic applies best-practice conventions for redirecting to the "pretty" canonical form of requested URLs including all lowercase and stripping off the
.html extension. This has the effect of ensuring that every webpage on your site can only be accessed with the one "true" URL. Other variations (trailing slashes, letter case, and file extensions)
301 redirect to the official URL. This has big SEO benefits as it ensures that search engines don't dilute the value of your pages with multiple copies competing against each other.
The table below illustrates how Aerobatic handles some common scenarios with no special configuration on your part:
|Request URL||File exists test||Render page||Redirect url||Response Code|
|No condition matches||Default or custom error page|
Aerobatic out of the box serves your site using industry standard HTTP performance best practices including GZIP compression and cache control headers. Aerobatic uses a multi-layered caching strategy based on the types of assets being served. Our approach closely mirrors these Google web performance best-practices.
Your web pages are served from our origin servers with an
ETag header that uniquely identifies the current deployed version of your website. On subsequent requests, your visitors' browser will send an
If-None-Match header corresponding to the previous
ETag. Assuming a new version has not been deployed in the meantime, Aerobatic will return an empty
304 Not Modified response informing the browser that the copy it has in cache is still valid. This cuts down considerably on the number of bytes sent over the network resulting in a faster site. Because the browser is forced to re-validate on each page request, you can be assured that all users will immediately get the most recent version after a new deployment and not a stale copy from cache.
If you are deploying a single page app (SPA) with client-side routing, then your likely want to serve your main
index.html page for all extension-less URLs. To force this behavior, just set the
pushState property to
true on the webpage plugin.
plugins: - name: webpage options: pushState: true