mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
feat: separate new frontend api path for perf measurements (#6583)
This commit is contained in:
parent
5d107581b1
commit
2716f72ea6
@ -213,6 +213,14 @@ export default class FrontendAPIController extends Controller {
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
this.config.flagResolver.isEnabled('returnGlobalFrontendApiCache')
|
||||
) {
|
||||
toggles =
|
||||
await this.services.frontendApiService.getNewFrontendApiFeatures(
|
||||
req.user,
|
||||
FrontendAPIController.createContext(req),
|
||||
);
|
||||
} else {
|
||||
toggles =
|
||||
await this.services.frontendApiService.getFrontendApiFeatures(
|
||||
@ -221,19 +229,13 @@ export default class FrontendAPIController extends Controller {
|
||||
);
|
||||
}
|
||||
|
||||
const returnedToggles = this.config.flagResolver.isEnabled(
|
||||
'returnGlobalFrontendApiCache',
|
||||
)
|
||||
? newToggles
|
||||
: toggles;
|
||||
|
||||
res.set('Cache-control', 'no-cache');
|
||||
|
||||
this.services.openApiService.respondWithValidation(
|
||||
200,
|
||||
res,
|
||||
frontendApiFeaturesSchema.$id,
|
||||
{ toggles: returnedToggles },
|
||||
{ toggles },
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ process.nextTick(async () => {
|
||||
sdkReporting: true,
|
||||
outdatedSdksBanner: true,
|
||||
globalFrontendApiCache: true,
|
||||
returnGlobalFrontendApiCache: true,
|
||||
returnGlobalFrontendApiCache: false,
|
||||
},
|
||||
},
|
||||
authentication: {
|
||||
|
Loading…
Reference in New Issue
Block a user