Skip to content

Commit 8a45ad8

Browse files
thomaspoignantKavindu-Dodantoddbaert
committed
feat: Specify caching for OFREP in server providers (#17)
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com> Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com> Co-authored-by: Todd Baert <todd.baert@dynatrace.com> Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent 9a9b0bb commit 8a45ad8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

service/openapi.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ paths:
4848
content:
4949
application/json:
5050
schema:
51-
$ref: '#/components/schemas/evaluationSuccess'
51+
$ref: '#/components/schemas/serverEvaluationSuccess'
5252
'400':
5353
description: Bad evaluation request
5454
content:
@@ -223,6 +223,13 @@ components:
223223
properties:
224224
context:
225225
$ref: '#/components/schemas/context'
226+
serverEvaluationSuccess:
227+
allOf:
228+
- $ref: "#/components/schemas/evaluationSuccess"
229+
- properties:
230+
cacheable:
231+
type: boolean
232+
description: Let the provider know that this flag evaluation can be cached
226233
evaluationSuccess:
227234
description: Flag evaluation success response.
228235
allOf:
@@ -363,6 +370,8 @@ components:
363370
$ref: '#/components/schemas/featureCacheInvalidation'
364371
flagEvaluation:
365372
$ref: '#/components/schemas/flagEvaluation'
373+
caching:
374+
$ref: '#/components/schemas/featureCaching'
366375
flagEvaluation:
367376
type: object
368377
description: Configurations specific for flag evaluations in OFREP provider implementation
@@ -400,3 +409,15 @@ components:
400409
- 60000
401410
required:
402411
- name
412+
featureCaching:
413+
type: object
414+
description: Configuration of the caching mechanism in the provider (used by server providers)
415+
properties:
416+
enabled:
417+
type: boolean
418+
description: set to true if you want the provider to cache the evaluation results
419+
ttl:
420+
type: number
421+
examples:
422+
- 1000
423+
description: number (in millisecond) to wait before invalidating the cache. If we have cacheInvalidation enabled, the cache can also be evicted if a configuration change happen.

0 commit comments

Comments
 (0)