When manually executing Element API endpoint queries via Craft::$app->request->setPathInfo($endpoint); Craft::$app->runAction('element-api', ['pattern'=>$endpoint]), Element API caching is not working correctly as getPathInfo() does not return the updated path. Fixed by changing to getPathInfo(true).
When manually executing Element API endpoint queries via Craft::$app->request->setPathInfo($endpoint); Craft::$app->runAction('element-api', ['pattern'=>$endpoint]), Element API caching is not working correctly as getPathInfo() does not return the updated path. Fixed by changing to getPathInfo(true).