I'm struggling in something i don't know at all. When the time i ping my website, i got this result: [Serve the following static resources from a domain that doesn't set cookies:]
. And, this result caused from the images which i used for background images. I tried to google about this topic but all the answers seem to be difficult to understand of. Does anyone here knows about it and any simple solution to fix it up?
The following steps outline how to use cookie-free domains in WordPress: 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 of your WordPress installation.
In IIS, go to the Home Directory tab, then click the "Configuration" button. Next go to the Options tab and un-check "Enable session state". The cookie will go away, and you can leave your files where they are with no need for an extra domain or sub-doamin.
Any website needs a cookie-less domain. This (sub)domain is typically called “static”. It is used to serve Javascript, CSS, images and other static content. The reason for static content to be on a cookie-less domain is that it makes the content load faster.
Generally, when you are serving content such as images, JavaScript, CSS, there is no reason for a HTTP cookie to accompany it, as it creates additional overhead. That is why a lot of tools report this. Here are two quick and easy options:
Option 1 - Use a CDN
Use a CDN to host your images which has the ability to ignore cookies as well as strip cookies which will completely prevent the client from receiving the Set-Cookie response header. Note: You can't disable cookies on Cloudflare.
Option 2 - Point Static Assets to New Domain
This is an example with WordPress.
define("WP_CONTENT_URL", "http://static.domain.com");
define("COOKIE_DOMAIN", "domain.com");
See more in this post on how to fix the Serve Static Content From a Cookieless Domain warning.
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