Setting up Cookieless Domain

Discussion regarding Joomla! 1.5 Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security and Performance FAQs
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
getdown
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Nov 17, 2009 7:44 pm

Setting up Cookieless Domain

Post by getdown » Tue Nov 16, 2010 9:28 pm

I'd like to move as much of my static content as possible to a cookieless domain. Down the line I'll probably look into and set up a cnd (CND for Joomla! by NoNumbers! seems very well supported). However, what I am contemplating at the moment is simply hard coding an absolute URL into all of my css/articles/ect to the static domain.

Is it possible to point that domain at the same Joomla root folder so that I don't have to manually copy the static content to a sub-directory to keep the cookie from being set?

I was thinking possible to to prevent cookies from being set on a particular domain via .htaccess, and possibly re-write any url request to the static domain to the primary domain to prevent access to the site through the static domain.

There might be a better way to do this, if so feel free to speak up.

Basically:
live site = example.com
static site = static.com
Both point to joomla root directory

Can I use .htaccess to prevent access to any non-static content on static.com?

Can I use .htaccess to always un-set any cookies on static.com only?

getdown
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Nov 17, 2009 7:44 pm

Re: Setting up Cookieless Domain

Post by getdown » Tue Nov 16, 2010 9:56 pm

It seems like this would work if I could use .htaccess to limit the static domain to serving only static content: http://symkat.com/105/cookieless-domains/

Than I could use a CND plugin to request all of the static content from the static domain.

Would I need to do anything in that case to make sure that the static domain never set any cookies?

almooj-craig
Joomla! Guru
Joomla! Guru
Posts: 500
Joined: Mon Aug 11, 2008 3:05 pm

Re: Setting up Cookieless Domain

Post by almooj-craig » Fri Nov 19, 2010 6:44 am

I would be better to set up a new paired down virtual host for the other sub domains. Currently I use a.domain.com and b.domain.com for static resources and www.domain.com for content, these all point to the same document root directory. There is no cookie set for the static elements that are on a or b, but the one static .js file which is on the www domain does get cookies set.

For example if you rewrote all of your images into the a directory using mod_rewrite it would waist a lot of time because of the 301 redirects, so you really need to use a preg_replace_callback to change the domains in the html before you cache or serve it out. If you use two sub domains for the static content most browsers will be able to download more content concurrently. Just use an algorithm on the file names so that they always get assigned to the correct static domain.

In your a and b sub domains you can use mod_rewrite to move content back to www.

Craig

OlympiaWatch
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Jan 26, 2016 1:39 am

Re: Setting up Cookieless Domain

Post by OlympiaWatch » Mon Feb 01, 2016 7:39 pm

Is there an extension out there that does all of the above without having to edit the core code of the site and other extensions to be able to make these changes.

And then it would also put lines in your .htaccess file to redirect anything from a.domain.com or b.domain.com that does not match the filetypes or folder locations of your static content, back to www.domain.com (or you could add these lines manually etc.) and you could split it into say images and javascript/css and have one group per domain (or even use a 3rd domain perhaps?)

Surely there must be an interest in this kind of stuff to the extent that someone has built an extension or two that do this?

astarmaths
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 188
Joined: Wed Dec 03, 2008 11:27 am
Location: London
Contact:

Re: Setting up Cookieless Domain [SOLVED]

Post by astarmaths » Tue Mar 08, 2016 8:29 am

Soled it.
I disabled all cookies with an extension.
When I enabled cookies, I could log in and register.


Locked

Return to “Performance - Joomla! 1.5”