how to use cookie-free domains (yslow)

Mario picture Mario · Oct 3, 2014 · Viewed 66.4k times · Source

I was trying to solve the problem with cookie-free, the yslow has suggested to create a subdomain. I did, but the yslow still "show" the problem.

i didn't set the cookie´s domain in the page, cause i don't know how to do it.

anyone know a tutorial or a solution to this problem?

Answer

Leandro Costa picture Leandro Costa · Mar 17, 2017

Create a subdomain such as static.yourwebsite.com which is where you will deliver all your static files from.

Point your new subdomain to the /wp-content directory for a WordPress installation.

For cPanel users, you will need to update the document root field from public_html/static to public_html/wp-content like the screenshot below. cpanel document root

Edit your config.php file to reflect the following:

define("WP_CONTENT_URL", "http://static.yourwebsite.com");

define("COOKIE_DOMAIN", "www.yourwebsite.com");

Now that your cookie domain and static content subdomain are set, you can begin delivering static content without the server setting an unnecessary cookie for static assets.

https://www.keycdn.com/support/how-to-use-cookie-free-domains/