Summary
We have created a PHP script that automatically redirects the user to the appropriate language version of the website, it does it in the language of the browser. The script works properly after clearing the cache, but after 1-2 minutes the script stops working. It seems to me that this is some kind of cache error because after clearing it, the script works fine again for 1-2 minutes.
Step to reproduce
The code is added correctly in the snippet.
Observed behavior
The script works only for a while after clearing the cache after about 1-2 minutes it stops working.
Expected behavior
Script running continuously.
Environment
MODX Revolution 2.6.5-pl