The Hood is ablaze with the no-cost Static Site Hosting - (r)
-sidebar-toc>
In the beginning, when "World web" was first made available to the general public in 1991 back then the web was a collection made up from static HTML documents - each file with the necessary markup to display the whole page in the web browser. Within seconds, the web's first designers began to develop methods to develop dynamic websites, which were created with code run on web servers, and importing information from databases.
Although static websites didn't wholly disappear while CMSs came to dominate, a fresh way of thinking about static sites is now gaining popularity among users who are concerned about speed and security.
We will take a closer look at static sites and what can you do to make them more accessible for deploying these on servers that are located in the edge of the world.
Are you able to make a Static Site suitable to your Web Project?
What types of projects are able to be deployed as static web sites?
"If you do not have pages where users have to log in, there isn't a database or anything else that needs dynamic content then it's probably a good opportunity to convert it into an unresponsive web page" Fuller says. "This could include items such as portfolios, marketing websites, or even a blog, if you're creating content using an automated static site generator."
If a website does not have a database or server to join, it offers less security vulnerabilities.
"For higher-level situations you can use two approaches," Fuller says. "You can build a static website that utilizes the JavaScript framework to connect to an unrelated server. This means you'll enjoy the speed benefits with your loading times and the flexibility of the dynamic website."
An Overview of Static Web Hosting
Here's what you will get for free through the Static Site hosting platform.
- 100 static sites per company
- 1 concurrent construction per site
- 1 GB size for image building per site
- 600 build minutes per month per company
- 100 GB bandwidth per month per company
Installation of a static site
Once you've granted My's access your Git service, you're able to begin to create your very first static website. You can decide on the repository it is in and its branch:
Below, we've picked Automatic deployment after commit this means that we redeploy the site when changes are committed on the appropriate branch on the Git host.
Next, My will attempt to find the necessary requirements needed to complete your project.
"If we are able to detect the package manager and generator that you're using. Then we'll fill them in with the methods that were employed to create these," Fuller says. "For instance, the option used for Node.js-powered builds typically is yarn build or npm run build. The publish directory typically has the equivalent of dist, build public and also out."
"For the first release of Static Site Hosting, we are supporting Node.js for the creation of websites." Fuller states, "but we're currently working on adding additional platforms to come later."
Also, it is possible to make use of static assets that have zero build process such as basic HTML sites.
"If you're not running a generator, there is no build command needs to be entered and we assume that your repository contains pre-made files," Fuller says.
When a deployment has been activated and completed, it's placed in the site's build queue.
"When the deployment is launched it creates a build instance in Google Cloud Platform and pull the code source from your repository" Fuller says. "If the build command is set, we employ an image created on the platform you specify -- which is Node.js at present in order to execute that command. Then, we verify the size of each file in the publish directory to verify that it's line with our limitations."
"The next step is upload. We push your files to a Cloudflare R2 storage bucket."
Maximizing Speed With Increased deployments
The Static Site Hosting deployment process optimizes build times by transferring to Cloudflare servers only files that have actually changed.
"We preserve previously uploaded files that were accumulated through multiple deployments. Therefore, if you want to deploy a previous version again there are fewer uploads to make is very small," Fuller says. "To achieve this, we change the names of files to match the hash value for their content and keep track of the paths previously employed. Files are kept in a mapping for specific deployments, with paths as keys and the updated name as an alternative value."
"When a request is sent to us using the map of the present installation in order to redirect the request the right Version of the document."
Summary
Their Static Website Hosting Platform delivers rapid content delivery over an incredible network of the latest servers, backed by My Dashboard. This makes the deployment process simple.
The best part is that it's free.
Steve Bonisteel
Steve Bonisteel is a Technical Editor. He started his writing career as journalist for a newspaper, chasing ambulances and fire trucks. The journalist has covered internet-related technologies since the mid 1990s.
This post was posted on here