4 ms·
Not generating the www redirect (IMO that's more of a web server / application layer job than a cache job); but you can make varnish cache www and non-www objec
by Shish2k 12y ago
Not generating the www redirect (IMO that's more of a web server / application layer job than a cache job); but you can make varnish cache www and non-www objects together:
if (req.http.host == "www.foo.net") {
set req.http.host = "foo.net";
}
- harshreality 12y agoIs this ever a good idea? Doesn't making www.foo.net and foo.net separate but identical cause an indexing split (and index ranking split) at search engines? Why would you ever want that split for the same pages at two different domains, unless they're serving different content?
- Shish2k 12y agoNow that you mention it, I forget why that specific snippet is in my config... it is part of a block of similar-but-more-useful things (specifically, having multiple caches serving the same static content from a variety of different domain names)
- sandGorgon 12y agoso, what's the answer - this is why Varnish is so confusing. I have my non-www to www redirects working perfectly on nginx. should I do anything special in varnish, or should I trust it to cache the nginx redirect headers by itself ?
- Shish2k 12y agoThe answer is have nginx do the redirect, varnish will handle it correctly