Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Cache-Control #958

Merged
merged 6 commits into from
May 27, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions advanced/fiori.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,20 @@ If you have the need for a more complex calculation, then the interesting parts
:::


## Cache Control

CAP provides the option to set a [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) header with a [max-age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#max-age) directive to indicate that a response remains fresh until _n_ seconds after it was generated .
In the CDS model, this can be done via a `@http.CacheControl: {maxAge: <seconds>}` annotation on stream properties. The header indicates that caches can store the response and reuse it for subsequent requests while it's fresh.
agoerler marked this conversation as resolved.
Show resolved Hide resolved
The `max-age` (in seconds) specifies the maximum age of the content before it becomes stale.

:::info Note
agoerler marked this conversation as resolved.
Show resolved Hide resolved
The `max-age` is the elapsed time since the response was generated on the origin server (not the elapsed time since the response was received).
agoerler marked this conversation as resolved.
Show resolved Hide resolved
:::

eugene-andreev marked this conversation as resolved.
Show resolved Hide resolved
::: warning Only Java
Cache Control feature is currently supported on the Java runtime only.
:::

<div id="client-side-validations" />

<div id="fiori-compat" />
Expand Down
Loading