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?
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/
To work around this problem, make sure that static components are requested with cookie-free requests by creating a subdomain and hosting them there.
If your domain is www.example.org
, you can host your static components on static.example.org
. However, if you've already set cookies on the top-level domain example.org as opposed to www.example.org
, then all the requests to static.example.org
will include those cookies.
In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free.
Yahoo! uses yimg.com
, YouTube uses ytimg.com
, Amazon uses images-amazon.com
and so on.
Read More
Serve static content from a different domain to avoid unnecessary cookie traffic. When the browser requests a static image and sends cookies with the request, the server ignores the cookies. These cookies are unnecessary network traffic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With