Skip to content

Commit

Permalink
feat: Specify caching for OFREP in server providers
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
  • Loading branch information
thomaspoignant authored and Kavindu-Dodan committed Jun 21, 2024
1 parent 0c74c1e commit d3d4c41
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions service/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/evaluationSuccess'
$ref: '#/components/schemas/serverEvaluationSuccess'
'400':
description: Bad evaluation request
content:
Expand Down Expand Up @@ -221,6 +221,13 @@ components:
properties:
context:
$ref: '#/components/schemas/context'
serverEvaluationSuccess:
allOf:
- $ref: "#/components/schemas/evaluationSuccess"
- properties:
cacheable:
type: boolean
description: Let the provider know that this flag evaluation can be cached
evaluationSuccess:
description: Flag evaluation success response.
allOf:
Expand Down Expand Up @@ -354,6 +361,8 @@ components:
$ref: '#/components/schemas/featureCacheInvalidation'
flagEvaluation:
$ref: '#/components/schemas/flagEvaluation'
caching:
$ref: '#/components/schemas/featureCaching'
flagEvaluation:
type: object
description: Configurations specific for flag evaluations in OFREP provider implementation
Expand Down Expand Up @@ -390,4 +399,16 @@ components:
examples:
- 60000
required:
- name
- name
featureCaching:
type: object
description: Configuration of the caching mechanism in the provider (used by server providers)
properties:
enabled:
type: boolean
description: set to true if you want the provider to cache the evaluation results
ttl:
type: number
examples:
- 1000
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 comments on commit d3d4c41

Please sign in to comment.