Jump to content


Photo

cookie-less subdomain


  • Please log in to reply
5 replies to this topic

#1 Adam

Adam

    Member

  • Members
  • PipPip
  • 61 posts
  • Gender:Male

Posted 26 March 2011 - 01:12 PM

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.
  • 0
Countdown to tomorrow: 1 day.

My blog -- rubiverse.net

#2 Brian Stevenson

Brian Stevenson

    Newbie

  • Members
  • Pip
  • 17 posts

Posted 28 March 2011 - 08:30 AM

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');

  • 0

#3 balan

balan

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 October 2011 - 04:57 AM

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...
  • 0

#4 Scott

Scott

    MDDHosting Staff

  • Staff Administrator
  • PipPipPipPip
  • 421 posts
  • Gender:Male

Posted 29 October 2011 - 01:03 AM

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.
  • 0
Scott S - MDDHosting LLC - Providing Hosting since 2007
Scalable shared hosting plans in the cloud! Check them out!
Highly Available Cloud Shared, Reseller, and VPS
http://www.mddhosting.com/

#5 Adam

Adam

    Member

  • Members
  • PipPip
  • 61 posts
  • Gender:Male

Posted 29 October 2011 - 09:30 PM

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.
  • 0
Countdown to tomorrow: 1 day.

My blog -- rubiverse.net

#6 MikeDVB

MikeDVB

    Forum Administrator

  • Staff Administrator
  • PipPipPipPipPip
  • 2,900 posts
  • Gender:Male
  • Location:Central Indiana, USA

Posted 09 November 2011 - 03:16 PM

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.
  • 0
Michael Denney - MDDHosting LLC - Providing Hosting since 2007
Scalable shared hosting plans in the cloud! Check them out!
Highly Available Cloud Shared, Reseller, and VPS
http://www.mddhosting.com/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users