https://www.icyphoenix.com/viewtopic.php?f=28&t=7191
-----------------------------------
Danielc
Mon 14 Jun, 2010 18:31

Static Content From A Subdomain.
-----------------------------------
Hello Everybody.

I'm interested in optimize my IP installation. My web is http://www.miiconsola.com .

I have done a few modifications related to the performance, but i don't know how to change the URI only for static content.

As i use www always, using another subdomain which doesn't use cookies would increase the performance of my site, as the client doesn't have to send the cookies in the header.

Is there any constant (or var) i can modify to do this ? 

Thanks for your help


-----------------------------------
Mighty Gorgon
Tue 22 Jun, 2010 08:42

Re: Static Content From A Subdomain.
-----------------------------------
Sorry, but I do not understand what you need. Can you please try to add some details?

Thanks,
Luca


-----------------------------------
Danielc
Tue 22 Jun, 2010 17:30

Re: Static Content From A Subdomain.
-----------------------------------
First, thanks for the answer. I give more details:

As Icy Phoenix uses cookies, my current domain (www.miiconsola.com) uses cookies. When a web browser sends a request to www.miiconsola.com, it sends the cookies in the header. It does this even with static content (like images, css, etc., that doesn't need in any way cookies) from www.miiconsola.com. If we could use another subdomain (for example static.miiconsola.com) for the static content, then the browser wouldn't send the cookies in the header when it is downloading static content (as there is no cookies for static.miiconsola.com), and the performance would be increased.
I want to apply this, so i have to replace some images-related url's. I think that i should modify template files. Am I correct? Is there "an easy way" to do this?

Thanks!

Greetings.


-----------------------------------
Mighty Gorgon
Tue 22 Jun, 2010 19:09

Re: Static Content From A Subdomain.
-----------------------------------
I need to have a deeper look at the code before being able to answer. I'm not quite sure that cookies are processed also for images.

Adding another domain for images is surely good because of http requests to a different domain (and this usually speeds up page loading), but I'm not aware on how cookies are processed. Can you please explain me (or link some pages about this topic) further?


-----------------------------------
Danielc
Tue 22 Jun, 2010 20:12

Re: Static Content From A Subdomain.
-----------------------------------
Look at this:
http://code.google.com/intl/es-ES/speed/page-speed/docs/request.html#ServeFromCookielessDomain

Some tips to get a better performance (i have done this on my website):
Add this to .htaccess:
[code]<FilesMatch "\.(ico|gif|jpeg|jpg|png|css)$">
Header set Cache-Control "max-age=29030400, public"
Header unset ETag
FileETag None
</FilesMatch>[/code]
This extends the expiration date of images and disable ETag which usually doesn't work as expected.

Also i edited overall_header_js.tpl to combine all javascripts and compress them using minify. This works well and reduces so much the page size and speed up it..

Thanks!


-----------------------------------
Mighty Gorgon
Wed 23 Jun, 2010 20:20

Re: Static Content From A Subdomain.
-----------------------------------
Thanks, I'll have a look.


-----------------------------------
Danielc
Thu 24 Jun, 2010 17:57

Re: Static Content From A Subdomain.
-----------------------------------
Perfect.. I will try to do it on my own way, but it would be good that it is included in the next release :) 

Also, in the page i linked say that you have to buy another domain, but if you use URL's with www (for example www.miiconsola.com) the cookies would be only for www domain (www.miiconsola.com) and not for the domain without www (in this case the cookies would be for miiconsola.com and all his subdomains).

Thanks!


-----------------------------------
Mighty Gorgon
Tue 29 Jun, 2010 23:08

Re: Static Content From A Subdomain.
-----------------------------------
I had just a quick look so far... please be patient a bit about this topic, because I need to have some free time to be able to answer correctly.

If you don't get any answer in a couple of week, please bump... :mricy:


-----------------------------------
Danielc
Wed 30 Jun, 2010 18:40

Re: Static Content From A Subdomain.
-----------------------------------
Perfect.. I will wait.. While that, i will work in a template for my web.

Thanks!


