gTranslate and caching file issue
-
I have been testing gtranslate plugin for site translation and I am running into an issue with caching content where there are query string parameters present in the url in the original language only. ( I am using a path approach for content translation eg: domain.com/es for spanish)
In the inc/cache.php file in your plugin, there is a code snippet specifically for the gtranslate plugin( line 92) where it first checks if its activated
If it is, it first checks if there is a cache file with the language code and the REQUEST_URI , if not it checks REDIRECT_URL and If not it checks REQUEST_URI.
The problem is that in the original language, it will bypass the first check since the language code is not present and then in the REDIRECT_URL check, it passes, since it will only contain the path but no querystring parameters and this is the cache file that gets loaded up. So any querystring url will just load from that REDIRECT_URL cache file name.
Ex: domain.com/hello-world/ cache file will load the same for domain.com/hello-world/?page=1If the REDIRECT_URL check is necessary, you may need to also include the REDIRECT_QUERY_STRING as part of the cache filename if WPFC_CACHE_QUERYSTRING is set to true, that way it can uniquely cache paths with querystring
- The topic ‘gTranslate and caching file issue’ is closed to new replies.