LScache
Compatibility issue with LScache
LScache uses so called “Cache Vary”. That means each URL can be cached with different cache copies depending on user related facts like cookie, device and many others. The problem is that Weglot uses PHP and detects language using PHP, but if a page is cached there is no more PHP interpretor, because a cached URL is pure plain text and plain text can’t execute PHP. To make Weglot work with LScache a cookie must be set with different cookie value depending on the selected language. Then this cookie can be used for cache vary so each language gets its own cached copy.
To make it works you can modifiy your Litespeed Vhost with this code :
Be careful, in some cases, if the Litespeed server is a “fake”, configured with reverse proxies by the host, this code must be added to the Litespeed Vhost. Unfortunately, some hosts do not allow this...
Last updated