Skip to content

Commit d3d4c41

Browse files
thomaspoignantKavindu-Dodan
authored andcommitted
feat: Specify caching for OFREP in server providers
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent 0c74c1e commit d3d4c41

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

service/openapi.yaml

Lines changed: 23 additions & 2 deletions
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:
@@ -221,6 +221,13 @@ components:
221221
properties:
222222
context:
223223
$ref: '#/components/schemas/context'
224+
serverEvaluationSuccess:
225+
allOf:
226+
- $ref: "#/components/schemas/evaluationSuccess"
227+
- properties:
228+
cacheable:
229+
type: boolean
230+
description: Let the provider know that this flag evaluation can be cached
224231
evaluationSuccess:
225232
description: Flag evaluation success response.
226233
allOf:
@@ -354,6 +361,8 @@ components:
354361
$ref: '#/components/schemas/featureCacheInvalidation'
355362
flagEvaluation:
356363
$ref: '#/components/schemas/flagEvaluation'
364+
caching:
365+
$ref: '#/components/schemas/featureCaching'
357366
flagEvaluation:
358367
type: object
359368
description: Configurations specific for flag evaluations in OFREP provider implementation
@@ -390,4 +399,16 @@ components:
390399
examples:
391400
- 60000
392401
required:
393-
- name
402+
- name
403+
featureCaching:
404+
type: object
405+
description: Configuration of the caching mechanism in the provider (used by server providers)
406+
properties:
407+
enabled:
408+
type: boolean
409+
description: set to true if you want the provider to cache the evaluation results
410+
ttl:
411+
type: number
412+
examples:
413+
- 1000
414+
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)