What is Jamstack?
The Jamstack (JavaScript, APIs, and Markup) architecture is a modern API-first approach to building websites. In Jamstack, the web experience layer is decoupled from data and business logic, improving flexibility, scalability, and performance. Such websites are known to provide faster load times, improved security, and better scalability.
Jamstack sites also use pre-rendering, where the site is generated in advance, and the server only needs to serve static files. This approach reduces the need for server-side processing, resulting in faster load times and improved performance overall – key to getting good Core Web Vitals metrics.
For a framework-specific example of static pre-rendering—and a discussion of when dynamic pages may need server-side rendering—see our TanStack Start pre-rendering guide. The rendering strategy still needs to fit each page's content and requirements.
What are core web vitals?
Core Web Vitals are three measures of real-world page experience: Largest Contentful Paint (LCP) for loading, Interaction to Next Paint (INP) for responsiveness, and Cumulative Layout Shift (CLS) for visual stability. INP replaced First Input Delay (FID) as the interactivity metric.
Largest Contentful Paint: Loading speed
This metric measures the time it takes for the main content of a page to load. It is measured using the Largest Contentful Paint (LCP) metric and should be less than 2.5 seconds.
As currently specified in the Largest Contentful Paint API, the types of elements considered for Largest Contentful Paint are:
<img>elements<image>elements inside an <svg> element<video>elements (the poster image is used)An element with a background image loaded via the url() function (as opposed to a CSS gradient)
Block-level elements containing text nodes or other inline-level text elements children.
LCP example (source)
Why is good LCP important?
Good Largest Contentful Paint (LCP) is important for a website or app because it directly impacts the user experience. LCP basically measures the loading speed of the largest element on a web page, such as an image or a block of text. A long LCP can make a website or app feel slow and unresponsive, which can lead to a poor user experience.
Interaction to Next Paint: Responsiveness
Interaction to Next Paint (INP) measures how promptly a page responds to interactions such as clicks, taps, and keyboard input, through to the next frame the browser paints. An INP of 200 milliseconds or less is considered good. Unlike the former FID metric, INP considers interactions throughout a visit, not just the first input delay.
Why is good INP important?
A slow response after a click, tap, or key press can make a page feel unresponsive. INP captures more of that experience than FID did: it includes the time spent waiting to handle an interaction, running its event handlers, and painting the resulting frame.
To improve responsiveness, inspect interactions that feel slow and reduce work that blocks their handlers or delays the next paint. Fast delivery of the initial page does not, by itself, make later interactions responsive.
Cumulative Layout Shift: Visual stability
To measure Visual Stability, Google uses the Cumulative Layout Shift (CLS) metric, which measures the visual stability of a page and should be less than 0.1. The metric is important for a website or app because it affects the visual stability of the page or app.
CLS measures the amount of unexpected layout shifts that occur on a web page or app during the loading process. Unexpected layout shifts can occur when elements on the page – images, text or buttons – shift position or move around unexpectedly. This can be frustrating for users, particularly if they are trying to interact with a specific element on the page.
Why is good CLS important?
Layout shift seriously impacts user experience on websites. For example, when the user is trying to click one button, and ends up clicking a different one because the layouts shifted in the website. This experience is often referred to as “jank” or visual instability, and is frustrating for the user.
An example of layout shift (source: web.dev)
A good CLS score is important for the user experience because it ensures that the web page or app is visually stable, and that users can interact with it without any unexpected shifts or movements of elements. A poor CLS score can lead to a negative user experience, with users becoming frustrated and potentially abandoning the page or app.
Improving the Cumulative Layout Shift (CLS) metric is important because it affects the visual stability and user experience. Improving CLS can also lead to higher search engine rankings, which can increase traffic and visibility.
Why is it important to measure and improve Core Web Vitals?
Overall, improving your website's Core Web Vitals is important for several reasons. It can improve the user experience of your website, which can lead to increased engagement, more time spent on your website, and – in the case of an ecommerce or SaaS website – a higher likelihood of converting visitors into customers.
Google has announced that it will use core web vitals as a ranking factor in search results starting in May 2021. This means that websites with better core web vitals are likely to rank higher in search results, which can lead to increased traffic and visibility for your website.
By improving your website's core web vitals, you can future-proof your website against changes in search engine algorithms and user expectations, ensuring that your website remains competitive and relevant.
How does Jamstack help improve Google’s Core Web Vitals?
Using the Jamstack architecture is conducive to building sites that have better core web vitals. There are several reasons for that.
Jamstack sites are built using static files, which are pre-built and served directly to users from a content delivery network (CDN). Web pages load faster because there is no need for server-side processing. Jamstack sites are designed to be fast and lightweight, which can significantly improve loading speed and performance.
Jamstack sites are designed to be more secure because they use pre-built static files. There are no server-side processes that attackers can exploit, and the CDN can act as a security buffer against DDoS attacks. This means that the user experience is not disrupted by security issues, leading to better core web vitals.
Jamstack sites are designed to be more scalable. Pre-rendered pages served from a CDN can absorb many requests without rebuilding each page for every visitor. But can a Jamstack site handle high traffic without slowing down? That depends on the whole site: uncached pages, APIs, personalization, and client-side code can still become bottlenecks. Plan and test those paths under expected load, and measure LCP, INP, and CLS for actual visitors rather than assuming that CDN delivery guarantees good Core Web Vitals.
Jamstack sites are designed to be more maintainable because they are built using modular code and APIs. This means that developers can build and deploy new features quickly and easily, without disrupting the existing website. This leads to better core web vitals because the website can be updated and maintained more easily, leading to better performance and user experience over time.
Why is Storyblok the perfect match for Jamstack and great Core Web Vitals?
Because Storyblok is a headless CMS, it can work with Jamstack websites. It provides a content management system that separates the content from the presentation layer, making it easier to deliver dynamic content with static files. With Storyblok, you can manage content separately from the frontend, which enables developers to work on the frontend and the backend simultaneously – without affecting the work of other teams. This leads to improved efficiency and reduced time to market.
CDN for speed
Storyblok delivers content API responses and assets through a CDN, which can help reduce delivery latency. That advantage alone does not establish better Core Web Vitals or search rankings for a finished site: rendering, images and client-side work also affect what visitors experience. To assess whether a change made your site faster, compare appropriate lab tests with real-user results; see how to distinguish a better Lighthouse score from a visitor-speed gain.
Pre-fetching for better LCP
Storyblok helps to improve loading speed by pre-fetching content and delivering it from a CDN. With Jamstack, you can build a website that loads quickly, and with Storyblok, you can ensure that your content is delivered quickly to your visitors.
Interactivity for better INP
Storyblok provides APIs for fetching content, but an API does not automatically improve INP. The frontend still needs to handle user interactions without excessive JavaScript work or delayed rendering. Measure responsiveness on the delivered site rather than assuming that fast content delivery guarantees it.
Visual stability for better CLS
Visual stability is another important core web vital, and Storyblok can help to improve this by providing automatic image optimization. Big, badly optimized images are a common source of visual instability. With Storyblok’s automatic image optimization, you can ensure that your images load quickly and smoothly, without affecting the stability of your website.
Conclusion
In conclusion, Storyblok and Jamstack are the perfect match for website owners and developers who are looking to improve the speed and performance of their website or app. With Jamstack, you can build a website that is fast, secure, and scalable, providing a better user experience for your visitors. By using Storyblok as part of a Jamstack site, you can manage your content separately from the frontend, improve loading speed, and achieve better core web vitals. By combining these two, you can ace your Core Web Vitals and achieve a higher ranking on search engines and deliver more engaging user experiences.
For an example of a website built with Storyblok and Next.js, read our MeisterTask case study. It describes the implementation and reports strong Core Web Vitals, though it does not provide numerical before-and-after results.