1
0
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:
Mateusz Kwasniewski 2024-03-15 12:31:08 +01:00 committed by GitHub
parent 5d107581b1
commit 2716f72ea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View File

@ -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 { } else {
toggles = toggles =
await this.services.frontendApiService.getFrontendApiFeatures( 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'); res.set('Cache-control', 'no-cache');
this.services.openApiService.respondWithValidation( this.services.openApiService.respondWithValidation(
200, 200,
res, res,
frontendApiFeaturesSchema.$id, frontendApiFeaturesSchema.$id,
{ toggles: returnedToggles }, { toggles },
); );
} }

View File

@ -52,7 +52,7 @@ process.nextTick(async () => {
sdkReporting: true, sdkReporting: true,
outdatedSdksBanner: true, outdatedSdksBanner: true,
globalFrontendApiCache: true, globalFrontendApiCache: true,
returnGlobalFrontendApiCache: true, returnGlobalFrontendApiCache: false,
}, },
}, },
authentication: { authentication: {