I am using fragment caching - the cache gets stored under RAILS_ROOT/ tmp/cache/www.mysite.com but if someone goes to http://mysite.com (no www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ mysite.com - from this point on, the cache is hit at both URL locations but I end up with 2X the DB hits and 2X over-the-wire web service calls etc I really need. This is turning out to be really really expensive. How can I avoid this? Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Sep-14 22:34 UTC
Re: How can I specify the location of the fragment cache?
> I am using fragment caching - the cache gets stored under RAILS_ROOT/ > tmp/cache/www.mysite.com but if someone goes to http://mysite.com (no > www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ > mysite.com - from this point on, the cache is hit at both URL > locations but I end up with 2X the DB hits and 2X over-the-wire web > service calls etc I really need. > > This is turning out to be really really expensive. How can I avoid > this? > > Any ideas?Not a solution to your problem directly, but you may want to consider 301 redirecting all requests to mysite.com to www.mysite.com. I know that Google will punish your page rankings if it sees the same content in multiple domains... As a side effect it would also solve your problem.. -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That''s an idea that would have the side-effect of solving my problem yes, but I don''t believe Google will punish PR between www and a plain site.com. As you say multiple domains: perhaps between alpha.com and beta.com if there''s exactly the same content, then... maybe. On Sep 14, 3:34 pm, Philip Hallstrom <ra...-SUcgGwS4C16SUMMaM/qcSw@public.gmane.org> wrote:> > I am using fragment caching - the cache gets stored under RAILS_ROOT/ > > tmp/cache/www.mysite.combut if someone goes tohttp://mysite.com(no > > www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ > > mysite.com - from this point on, the cache is hit at both URL > > locations but I end up with 2X the DB hits and 2X over-the-wire web > > service calls etc I really need. > > > This is turning out to be really really expensive. How can I avoid > > this? > > > Any ideas? > > Not a solution to your problem directly, but you may want to consider 301 > redirecting all requests to mysite.com towww.mysite.com. > > I know that Google will punish your page rankings if it sees the same > content in multiple domains... > > As a side effect it would also solve your problem.. > > -philip--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
phallstrom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-14 22:59 UTC
Re: How can I specify the location of the fragment cache?
You may be right... now that I think about it our problem was the individual hostnames vs www. It definitely punished us for that. On Sep 14, 3:51 pm, raghus <raghu.sriniva...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That''s an idea that would have the side-effect of solving my problem > yes, but I don''t believe Google will punish PR between www and a plain > site.com. As you say multiple domains: perhaps between alpha.com and > beta.com if there''s exactly the same content, then... maybe. > > On Sep 14, 3:34 pm, Philip Hallstrom <ra...-SUcgGwS4C16SUMMaM/qcSw@public.gmane.org> wrote: > > > > I am using fragment caching - the cache gets stored under RAILS_ROOT/ > > > tmp/cache/www.mysite.combutif someone goes tohttp://mysite.com(no > > > www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ > > > mysite.com - from this point on, the cache is hit at both URL > > > locations but I end up with 2X the DB hits and 2X over-the-wire web > > > service calls etc I really need. > > > > This is turning out to be really really expensive. How can I avoid > > > this? > > > > Any ideas? > > > Not a solution to your problem directly, but you may want to consider 301 > > redirecting all requests to mysite.com towww.mysite.com. > > > I know that Google will punish your page rankings if it sees the same > > content in multiple domains... > > > As a side effect it would also solve your problem.. > > > -philip--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2007-Sep-15 01:10 UTC
Re: How can I specify the location of the fragment cache?
On Fri, 14 Sep 2007, raghus wrote:> I am using fragment caching - the cache gets stored under RAILS_ROOT/ > tmp/cache/www.mysite.com but if someone goes to http://mysite.com (no > www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ > mysite.com - from this point on, the cache is hit at both URL > locations but I end up with 2X the DB hits and 2X over-the-wire web > service calls etc I really need. > > This is turning out to be really really expensive. How can I avoid > this?You can ensure they always visit the non-www version of your domain name. Here''s an Apache rewrite rule for that: RewriteCond %{HTTP_HOST} !^mysite.com$ [NC] RewriteRule ^(.*) http://mysite.com/$1 [L,R=301] -- Greg Donald Cyberfusion Consulting http://cyberfusionconsulting.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jacob Atzen
2007-Sep-15 16:50 UTC
Re: How can I specify the location of the fragment cache?
Greg Donald wrote:> On Fri, 14 Sep 2007, raghus wrote: >> I am using fragment caching - the cache gets stored under RAILS_ROOT/ >> tmp/cache/www.mysite.com but if someone goes to http://mysite.com (no >> www) then, a *second* cache gets stored at RAILS_ROOT/tmp/cache/ >> mysite.com - from this point on, the cache is hit at both URL >> locations but I end up with 2X the DB hits and 2X over-the-wire web >> service calls etc I really need. >> >> This is turning out to be really really expensive. How can I avoid >> this? > > You can ensure they always visit the non-www version of your domain > name. Here''s an Apache rewrite rule for that: > > RewriteCond %{HTTP_HOST} !^mysite.com$ [NC] > RewriteRule ^(.*) http://mysite.com/$1 [L,R=301]Beware. If you have multiple sites running under the same domain this will lead to trouble with cookies and IE. That is if you have both example.com and anotherapp.example.com. -- Cheers, - Jacob Atzen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---