Use Cookie Free Domains [Updated 2020]

USE COOKIE FREE DOMAINS

Cookie-free domains are intended to serve static files like images, CSS files, scripts, and others. When a browser makes a request for static images, it sends cookies along with the request and thus the user has to waste time and bandwidth while transmitting those cookies.

So if we can create a subdomain and make it cookie-free and point all static resources to it then it can increase our website speed substantially.

Cloudflare adds its own security cookies and so you can never go cookieless while using a Cloudflare CDN.

Serving static files from the cookie-free domain have very low priority and low effect on-site load. So, you can entirely ignore it.

It consists of 3 steps:

Step 1: Creating a subdomain in CPanel

Subdomains are very easy to create.

Go to your hosting provider CPanel> Domain> Sub domain

Put static in place of subdomain and select your domain name and Create.

Your subdomain is created.

 

Step 2: Using CDN Enabler Plugin to point the static resources to a cookie-free subdomain

Install and activate the CDN Enabler Plugin.

Go to settings> Put your sub-domain in CDN URL

Put static/wp-content in Included Directories and SAVE changes.

You are done.

 

Step 3: Installing Auto-optimize plugin

This has always been a game-changer plugin for me.

I love the simplicity of its coding and settings.

  • Install and activate auto-optimize
  • Do the proper settings as shown

For JS, CSS and HTML

For CSS

HTML

Leave the other settings as default.

Next, come to the images tab

Images

Leave the other tab settings as default.

GTmetrix results:

10 Comments

        Leave a Comment

        Your email address will not be published. Required fields are marked *

        *