RESTBase supports following on-wiki redirects with 302 responses and a relative link in a Location header. However, in case of CORS, browsers can respond in a weird way to redirects, effectively making redirect pages in CORS unreachable T149295
As a mitigation for this, if RESTBase detects a cross-origin request, it resolves the redirect internally, returning 200 response with the content of the redirect target. However, to fetch the redirect content, it uses public RESTBase URI, thus it's hitting the frontend caches, and forwards the response as-is, with all the cache-related headers, X-Cache, Age, etc.
According to @ema this is causing problems for ATS. So, in order to mitigate it, we need to change the code implemented in https://github.com/wikimedia/restbase/pull/702 to fetch the redirect target content directly from RESTBase, not from the caches and forward it.