Skip to content

Commit

Permalink
Invalidate cache in intermediate service
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Dec 15, 2023
1 parent 4e50dfc commit 95c9ec1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
19 changes: 18 additions & 1 deletion vocabularies/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,23 @@
"@Common.Experimental": true,
"@Core.IsURL": true,
"@Core.Description": "Base URL for WebSocket connections"
}
},
"InvalidateCache": [
{
"$Kind": "Action",
"@Common.Experimental": true,
"@Core.IsSignature": true,
"@Core.Description": "Invalidate cached data in an intermediate service",
"@Core.LongDescription": "A service that reads data from another service and transforms it upon request may keep a cache\n of the data it has read and serve multiple requests from it. This action then invalidates the cache, forcing\n the service to freshly read the data from the other service for the next request.",
"$Parameter": [
{
"$Name": "Entity",
"$Type": "Edm.EntityType",
"@Core.Description": "If present, invalidate the cache only for the given entity and its related entities",
"@Core.OptionalParameter": {}
}
]
}
]
}
}
17 changes: 17 additions & 0 deletions vocabularies/Common.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ Term|Type|Description
[PrimitivePropertyPath](./Common.xml#L1469:~:text=<Term%20Name="-,PrimitivePropertyPath,-") *([Experimental](Common.md#Experimental))*|[Tag](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#Tag)|<a name="PrimitivePropertyPath"></a>A term or term property with this tag whose type is (a collection of) `Edm.PropertyPath` MUST resolve to a primitive structural property
[WebSocketBaseURL](./Common.xml#L1474:~:text=<Term%20Name="-,WebSocketBaseURL,-") *([Experimental](Common.md#Experimental))*|URL|<a name="WebSocketBaseURL"></a>Base URL for WebSocket connections


## Actions

<a name="InvalidateCache"></a>
### [InvalidateCache](./Common.xml#L1480:~:text=<Action%20Name="-,InvalidateCache,-") *([Experimental](Common.md#Experimental))*

Invalidate cached data in an intermediate service

A service that reads data from another service and transforms it upon request may keep a cache
of the data it has read and serve multiple requests from it. This action then invalidates the cache, forcing
the service to freshly read the data from the other service for the next request.

Parameter|Type|Description
:--------|:---|:----------
*[Entity](./Common.xml#L1489:~:text=<Action%20Name="-,InvalidateCache,-")*|EntityType|*Optional parameter:* If present, invalidate the cache only for the given entity and its related entities


<a name="TextFormatType"></a>
## [TextFormatType](./Common.xml#L120:~:text=<EnumType%20Name="-,TextFormatType,-")

Expand Down
17 changes: 17 additions & 0 deletions vocabularies/Common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,23 @@ If the request succeeds the response will contain a JSON body of `Content-Type:
<Annotation Term="Core.Description" String="Base URL for WebSocket connections" />
</Term>

<Action Name="InvalidateCache">
<Annotation Term="Common.Experimental" />
<Annotation Term="Core.IsSignature" />
<Annotation Term="Core.Description" String="Invalidate cached data in an intermediate service" />
<Annotation Term="Core.LongDescription">
<String>A service that reads data from another service and transforms it upon request may keep a cache
of the data it has read and serve multiple requests from it. This action then invalidates the cache, forcing
the service to freshly read the data from the other service for the next request.</String>
</Annotation>
<Parameter Name="Entity" Type="Edm.EntityType" Nullable="false">
<Annotation Term="Core.Description" String="If present, invalidate the cache only for the given entity and its related entities" />
<Annotation Term="Core.OptionalParameter">
<Record />
</Annotation>
</Parameter>
</Action>

</Schema>
</edmx:DataServices>
</edmx:Edmx>

0 comments on commit 95c9ec1

Please sign in to comment.