Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language variations dont seem to be working #39

Open
antrecu opened this issue Apr 3, 2017 · 2 comments
Open

Language variations dont seem to be working #39

antrecu opened this issue Apr 3, 2017 · 2 comments

Comments

@antrecu
Copy link

antrecu commented Apr 3, 2017

Hi,

Using the VCL provided for a Drupal 7 installation seems to be working fine but when enabling multi language support ( just enable an extra language ) Varnish seems to stop caching pages, so i'm wondering if the VCL configuration provided is taking Language variations into consideration for caching? if you ever get a HIT on varnish it seems that cache works different per Browser.
There are multiple modules on Drupal 7 that are related to Languages that set cookies on the backed like Multilink (https://www.drupal.org/project/multilink) for caches pages in Drupal 7 so not sure if this is being handled as well on the provided config?.

i've added the following directive to the vcl_hash() routine to see if that might help but seems to be doing nothing.

sub vlc_hash(){
#...
#Uncomment if different languages are served at the same URL.
if( req.http.Accept-Language ) {
  hash_data(req.http.Accept-Language);
}
}

Thanks for your attention and clarifications.

@mattiasgeniar
Copy link
Owner

Hi!

If your module sets cookies to define the language, the current config should be sufficient: it'll look at different mutations of your cookies and cache those differently.

However, it's possible that your config has code in vcl_recv that does something like "if there are cookies, do not cache", which would bypass the cache as soon as you set a language cookie.

M.

@antrecu
Copy link
Author

antrecu commented Apr 5, 2017

not really, the module sets a Global cookie named "multilink_pl" that is set automatically when a user switches the language, when the cookie is set, varnish always throws MISS instead of HIT.
Tried with the same vcl_recv code of the provided config
so not sure how to by-pass this cookie and force varnish to cache the pages anyways

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants