Joe - Sub-directory Domain - Cookie-less domain cookie-free domain?

2 posts / 0 new
Last post
#1 Wed, 07/17/2019 - 08:26
Rory Bremner

Joe - Sub-directory Domain - Cookie-less domain cookie-free domain?

Hi all,

Trying to setup a cookie-less domain as it is called, for static asset delivery.
I need this for Opencart Journal 3 static asset delivery, useful as per Y-Slow reports.

Joe has mentioned this: https://www.virtualmin.com/comment/790516#comment-790516

Essentially I want static.mydomain.com to point to the same public-html folder of mydomain.com.
1. I created 'create alias for mydomain.com' and disabled 'Accept mail for domain?', 'Setup website for domain?'
However, I still get 'There are 41 components that are not cookie-free' in YSlow for many urls like 'https://static.mydomain.com'
How do I fix this?
2. What if I wanted to point to a subdirectory under public-html folder of mydomain.com?

Thanks

Wed, 07/17/2019 - 10:14
Rory Bremner

Regarding my point#1:
I think this is a false positive on YSlow, so I think that my static alias for mydomain.com is actually working OK.
I checked in Chrome Dev tools Network tab, and I don’t see any Set-Cookie headers.
This page states: https://www.keycdn.com/support/how-to-use-cookie-free-domains
"...as long as you have the strip cookies option enabled, even if you receive this warning it will be incorrect. YSlow does not take into consideration that the CDN actually strips the cookie and therefore may continue to throw the error. However, if you run a cURL command on the asset or check it within the Chrome Dev tools Network tab, you won’t see any Set-Cookie headers. Therefore this YSlow warning can be safely ignored."
I think YSlow is confused because my main domain is not a subdomain like 'www.mydomain.com'. It therefore assumes that static.mydomain.com will inherit cookies from mydomain.com.
In any case, I saw a 18% improvement in 'fully loaded times' on GTmetrix, so that's good.

Does anyone know anything about my point#2?
What if I just want a cookie-free domain to point to a subfolder in my main domain? Can we easily do this in Virtualmin?