How Webpages are Assembled

In this article we review how Zesty.io uses all of the content, files, and settings for a web property to generate the HTML, CSS and JavaScript for a webpage.

Webpage Basics

What is a webpage?

(If you know all this, jump down to the next section.)

Generally speaking, a webpage is a document served over the internet made up of HTML, CSS, and JavaScript. When you enter a URL into a browser, the computer powering that URL responds with the correct webpage document, and the browser interprets all that code. Once the code has been interpreted the browser renders your web browsing experience - all you can see, hear, click, hover, tap, swipe, etc.

A webpage is made up of two main sections: a head and a body. The head is all the invisible information that the browser and other internet services need to know about the page. For example, the head is where you put the information you want a search engine to show when your page comes up as a result, or what image and copy you want social networks to show when someone shares a link to this page. The head also can contain references to files (e.g. style sheets or JavaScript) the browser needs to correctly render the page. The body is all the content and structure you can see in the browser including the header and footer, the big hero image, the page content, the social icons, and more.

Zesty.io Webpage Assembly

How Zesty.io renders a page can be unclear by simply looking at the interface. So, how does Zesty.io take the content, code, and settings from all over the interface and compile that into a document for the browser? We'll break everything into its parts and look at example code to determine where each piece comes from.

Part 1: Responding to the URL

When a valid request is made to a domain hosted by Zesty.io first we check to see if it matches the settings for that domain. Does http need to redirect to https? Does the root domain need to redirect to www.? Then we check the path. Does /blog/example-article/ have an entry in this Zesty.io account or does it redirect to /news/example-article/, or is it a 404? Once we arrive at the correct path and it is a real page on that Zesty.io site, the webpage begins compiling.

Part 2: Creating the Files

Zesty.io takes all of the editable style sheets including LESS, SCSS, and raw CSS, runs them through a compiler if necessary, minifies them and provides the browser with a single, clean site.css file. It does the same thing with editable Javascript files for a site.js file.

Part 3: Compiling the Head

The head is built based on the meta information of the page and the site-wide settings.

Here is a simplified <head> element featuring dynamic elements called out with content in curly brackets and where to edit in parentheses:

Part 4: Compiling the Body

When Zesty.io renders a webpage, within the <body> tag, it references the loader file. The two exceptions are Ajax URLs and 404 pages; they are loaded directly, as is. Within the Loader file there is a {{ current_view }} Parsley call. The current_view call, dynamically references the specific template for the webpage that's being rendered. For example, loading the homepage would use the homepage template file where the loader calls current_view. This allows for site-wide template features to be used, like a header, footer and using site-wide scripts like tracking pixels.

Here is an example loader file:

This is also where all the Parsley calls are replaced with the content they reference from the database. For example:


Part 5: Put it all together

Now that each of the individual pieces have been created and dynamic elements have been composed, the document is packaged and served to the browser.

A note on caching.

For Zesty.io websites with full caching enabled, this whole process does not happen every time your site is visited. It happens once, and is provided to our global content delivery network (CDN) as a static file, and isn't compiled again until there is an a publish event on the instance or 24 hours pass from when it was first cached.

Connect with Content Experts

Book a free 15-minute consultation with a content expert. Discuss your application, pain points and requirements. Understand how Zesty's lower total cost of ownership, features, functionality can elevate your business by creating extraordinary digital experiences.

Trusted By

zesty customer logo Sonyzesty customer logo Rocket Leaguezesty customer logo Singlifezesty customer logo Acornszesty customer logo Phoenix Sunszesty customer logo Wattpadzesty customer logo Corner Shopzesty customer logo Bjs

Start by Entering your Email

By submitting your email you agree to our terms and conditions


zesty customer logo zesty customer logo zesty customer logo