docs/current_docs/partials/cookbook/builds/_persist-service-state.mdx
The following Dagger Function uses a cache volume to persist a Redis service's data across Dagger Function runs.
<Tabs groupId="language" queryString="sdk"> <TabItem value="go" label="Go">Save data to a Redis service which uses a cache volume to persist a key named foo with value `123:
Retrieve the value of the key foo after recreating the service state from the cache volume: