Infrastructure
When you host your static site with Kinsta, your site is pushed to Cloudflare’s Content Delivery Network (CDN) with 260+ locations. A Content Delivery Network (CDN) is a geographically distributed network of servers that work together to deliver website content and other digital assets to users. CDNs are designed to improve content delivery’s performance, reliability, and scalability by reducing latency and optimizing data transfer.
Visitors to your site are served from the closest, fastest, and easiest-to-access CDN location, so data processing can occur much closer to the end users. In this guide, we’ll dive a little into the details of our Static Site Hosting infrastructure.
![A diagram of Kinsta’s Static Site Hosting infrastructure.](https://kinsta.com/_next/image?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F07%2Fkinsta-static-site-hosting-infrastructure.png&w=3840&q=75)
Deployment
Git Repository
Your static site’s code is stored within a Git repository. You can choose from any (or all) of the following:
MyKinsta Add/Deploy Static Site
In MyKinsta, when you add a static site, it connects to the Git repository to retrieve the site.
MyKinsta Bot
With Automatic deployment on commit enabled in your static site’s settings, if you commit a change or merge to your repository, the MyKinsta bot detects this, then pulls the site from your Git service provider and deploys the updated version of the site.
Kubernetes Pod
Kinsta communicates with the build service, which creates a Kubernetes Pod. Each pod is a standalone isolated environment for each and every deployment. The Kubernetes pod builds the site and pushes the content to the Cloudflare R2 storage.
Requests
Cloudflare R2 Storage
Cloudflare R2 Storage is a bucket system that holds all of the files that make up your site. Cloudflare then distributes copies or cached versions of the site to the edge servers within the CDN’s 260+ locations.
Cloudflare’s Globally Distributed Network (CDN)
Cloudflare’s CDN consists of numerous edge servers strategically located in various geographic locations close to end users. When a user requests content from your site, the CDN’s edge server closest to the user receives the request. If the requested content is already cached on that edge server, it can deliver it directly to the user without needing access to the origin server.
If the requested content is unavailable on the edge server, the CDN retrieves it from R2 Storage, where the content is stored. The CDN then caches the content on the edge server for subsequent requests, optimizing the delivery process.
The CDN employs load-balancing techniques to distribute incoming traffic across multiple edge servers. This ensures that the load is evenly distributed, reducing the risk of server overload and improving overall performance. Content delivery is further optimized by implementing techniques like intelligent routing, which delivers content to the end user based on factors such as:
- User location
- Network conditions
- Server load and capacity
- Content availability
This smart routing sends content requests to the most optimal edge server within the CDN to deliver your static site efficiently.