User283571144 posted
Hi alexpaul,
There are several ways to avoid this warning. The easiest way would be to use a CDN service and serve your static content through that. If that is not the option then I suggest you to create
a subdomain and use that for serving static content. I came across this warning on a few websites I host and this article here
https://www.cloudways.com/blog/serve-static-content-from-a-cookieless-domain-guide/ helped me out in fixing ‘Serve Static Content From a Cookieless Domain’ warning.
As far as I know, theServe static content from a cookieless domain means is that your content needs to come from a domain that has no cookies attached to it.
This is so that the client and the server don't have to waste resources on actually parsing and handling cookie data. You could use a sub-domain, assuming that you set your cookie path correctly.
Like this :
You should use below url as the static content instead of file path.
You should use
http://yourdomain/jquery-3.3.1.min.js
Instead of
../Scripts/jquery-3.3.1.min.js
Besides, to create a cookieless site (or subdomain, which is a very common best-practice) in IIS: you need to tell the website that you are not to use cookies.
Which means in IIS terms, not to use a session.
You should define the session to off.
<system.web>
<sessionState cookieName="What_ever" mode="Off" />
</system.web>
Notice: The attribute cookieless (true|false)does NOT mean 'send cookies/do not sent cookies). That's for using sessions with/without cookies. You should also use the domain
to host your static content.
Best Regards,
Brando