I know this question is debatable for the whole eternity, and most likely nobody knows the real philosophy of this problem. But I'm trying to solve the problem about 301 and 302 response headers in order to redirect correctly a canonical URL from non-www to www and do it SEO-efficient.
At the moment I'm using the following method to redirect my canonical URL from non-www to www
#RewriteCond %{HTTP_HOST} !^(www\.shangri\.us)?$
#RewriteRule (.*) http://www.shangri.us/$1 [R=301,L]
But using this code I get the following message in my PageSpeed report:
To speed up page load times for visitors of your site, remove as many landing page redirections as possible, and make any required redirections cacheable if possible.
http://shangri.us/ is a non-cacheable redirect to http://www.shangri.us/
So I'm trying to fix the PageSpeed advice about cacheable redirects (http://goo.gl/AWI0g4)
I've read that I need to use 302 response header in this case. I know the difference between permanent and temporal redirects (301/302), but I have a big dilemma about how to implement this on my site.
Although I don't want to use my root domain at all, I'm afraid of using 302 temporal redirect, because some people say it isn't the best way for SEO matters, but... aaaaaah I'm gonna go insane :(