Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildSep 25, 02:19

Page Location

Page Info

Layout default
Collection docs
Path _docs/jekyll/jekyll-performance-optimization.md
URL /docs/jekyll-performance-optimization/
Date 2019-06-28

Jekyll - Performance Optimization

Table of Contents

Performance.

Why Use Cookie-Free Domains?

Although cookies are very useful in some cases, in other cases - such as the delivery of static content, they can hinder performance. When a browser makes a request for a static asset such as an image or CSS file, there is no need for it to also send a cookie to the server. This only creates additional network traffic and since the files are static (they do not change) the server has no use for the added cookie.

When you use cookie-free domains you are able to separate the content that doesn’t require cookies from the content that does. This helps improve your site’s performance by eliminating unneeded network traffic.

Testing

image

2. Cache Header

Create netlify.toml

[build]
  command = "jekyll build"
  publish = "_site/"

[[headers]]
  for = "/assets/images/*"
  [headers.values]
    Cache-Control = "public, s-max-age=604800"
[[headers]]
  for = "/assets/css/*.css"
  [headers.values]
    Cache-Control = "public, s-max-age=604800"
[[headers]]
  for = "/assets/js/*.js"
  [headers.values]
    Cache-Control = "public, s-max-age=604800"

3. Reference