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?
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:
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.
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.