Serves Language Cookie
Fastly is using Varnish 2.1.5 and allows custom VCL. I created my vcl and it worked on my local server. By the way, when i converted it to make it work with fastly.
My site has multiple Languages with url: http:// domain(dot)com/en (English for example) and it creates the cookies name WebLang=en.
Here is my custom vcl file:
I am a bit confused with the vcl_recv. Shoult I add:
if (req.url ~ "en") {
set req.http.MyLang = "MyLang=en";
} elseif (req.url ~ "ja") {
set req.http.MyLang = "MyLang=ja";
} elseif (req.url ~ "es") {
set req.http.MyLang = "MyLang=es";
} elseif (req.url ~ "it") {
set req.http.MyLang = "MyLang=it";
} elseif (req.url ~ "de") {
set req.http.MyLang = "MyLang=de";
} elseif (req.url ~ "pt") {
set req.http.MyLang = "MyLang=pt";
} elseif (req.url ~ "fr") {
set req.http.MyLang = "MyLang=fr";
}
Thanks
Please sign in to leave a comment.
Comments
2 comments