Adam Posted March 26, 2011 Report Share Posted March 26, 2011 I have been trying to server all my static content from a cookie-less subdomain because it is supposed to improve site performance. I am having trouble getting my subdomain to not leave cookies. I am running a wordpress site on that domain and I put this into the wp-config.php: define('COOKIE_DOMAIN', 'lrastart.org'); My site is in my signature. Quote Link to comment Share on other sites More sharing options...
Brian Stevenson Posted March 28, 2011 Report Share Posted March 28, 2011 I have been trying to server all my static content from a cookie-less subdomain because it is supposed to improve site performance. I am having trouble getting my subdomain to not leave cookies. I am running a wordpress site on that domain and I put this into the wp-config.php: define('COOKIE_DOMAIN', 'lrastart.org'); My site is in my signature. Give this a try:define('COOKIE_DOMAIN', '.lrastart.org'); Quote Link to comment Share on other sites More sharing options...
balan Posted October 27, 2011 Report Share Posted October 27, 2011 I have been trying to server all my static content from a cookie-less subdomain because it is supposed to improve site performance. I am having trouble getting my subdomain to not leave cookies. I am running a wordpress site on that domain and I put this into the wp-config.php: define('COOKIE_DOMAIN', 'lrastart.org'); My site is in my signature. useful post...good work... Quote Link to comment Share on other sites More sharing options...
Scott Posted October 29, 2011 Report Share Posted October 29, 2011 There are a few parts to accomplishing this. First you must move the images to a different (sub)domain that is not included in any cookies you set. If the cookie is for example.com, then any subdomain is fine. If the cookie domain is .example.com (notice the leading dot), all subdomains would get the cookies and you would need to host the images on an entirely different domain. Second you would need WordPress to "know" that these images are located in a different location. I imagine there must be a plugin for this, but I am not aware of any off hand. Lastly, you need to be sure that nothing on the domain you use for images creates any cookies. You could also look into using a CDN service for this which would add some additional benefits (and costs, generally). We also offer a plugin for CloudFlare which provides a lot of optimizations, bandwidth savings, and even improves your security. Their basic plan is not only free, but very feature rich. They also offer premium plans with enhanced features and SSL support. With regards to CloudFlare, I strongly advise using the cPanel plugin instead of signing up with CloudFlare directly. The plugin does a lot of DNS work in the background and saves you a lot of headache in the event of IP address changes. Quote Link to comment Share on other sites More sharing options...
Adam Posted October 30, 2011 Author Report Share Posted October 30, 2011 Sorry for not updating this thread. I decided that it wasn't really necessary after all. First you must move the images to a different (sub)domain that is not included in any cookies you set. Although this would work, it's not the easiest way to do it. You could set a CNAME subdomain to point to your domain and call static resources from that subdomain. You don't have to move anything this way. Second you would need WordPress to "know" that these images are located in a different location. I imagine there must be a plugin for this, but I am not aware of any off hand. W3TC has a feature that allows you to have a "self-hosted CDN" and it does exactly this. Lastly, you need to be sure that nothing on the domain you use for images creates any cookies. That's what I had trouble with. You could also look into using a CDN service for this which would add some additional benefits (and costs, generally). We also offer a plugin for CloudFlare which provides a lot of optimizations, bandwidth savings, and even improves your security. Their basic plan is not only free, but very feature rich. They also offer premium plans with enhanced features and SSL support. With regards to CloudFlare, I strongly advise using the cPanel plugin instead of signing up with CloudFlare directly. The plugin does a lot of DNS work in the background and saves you a lot of headache in the event of IP address changes. I've been using CloudFlare before most people knew they existed, actually. I didn't know that the CF cPanel plugin does backend DNS work; that's interesting. Quote Link to comment Share on other sites More sharing options...
Michael D. Posted November 9, 2011 Report Share Posted November 9, 2011 I've been using CloudFlare before most people knew they existed, actually. I didn't know that the CF cPanel plugin does backend DNS work; that's interesting.It just modifies the www. CName to point at CloudFlare. The downside is that if you don't use the www. (i.e. your site without www. in front) then you'll need to change this behavior to use the www. or use CloudFlare's DNS. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.