plantuml
@startuml
!theme plain
skinparam BoxPadding 20
skinparam ParticipantPadding 20
participant "Client" as client
participant "API\nServer" as api
participant "Storage" as storage
client -> api: GET /api/exports/file.csv\nRange: bytes=0-1023
api -> storage: Read bytes 0-1023
storage --> api: Partial data
api --> client: 206 Partial Content\nETag: "abc123"\nContent-Range: bytes 0-1023/5000
note over client: Download interrupted\nat byte 1024
note over client: Client resumes\ndownload
client -> api: GET /api/exports/file.csv\nRange: bytes=1024-\nIf-Range: "abc123"
api -> storage: Check current ETag
storage --> api: Current ETag: "abc123"
api -> api: ETag matches:\nProceed with Range
api -> storage: Read bytes 1024-end
storage --> api: Partial data
api --> client: 206 Partial Content\nETag: "abc123"\nContent-Range: bytes 1024-4999/5000
note over client: Download completed
== Alternative: Ressource wurde modifiziert ==
client -> api: GET /api/exports/file.csv\nRange: bytes=1024-\nIf-Range: "abc123"
api -> storage: Check current ETag
storage --> api: Current ETag: "xyz789"\n(Resource changed)
api -> api: ETag differs:\nIgnore Range, send full
api -> storage: Read complete file
storage --> api: Full data
api --> client: 200 OK\nETag: "xyz789"\nContent-Length: 6000\n[Complete file]
note over client: Client receives\nfull updated file\ninstead of partial
@enduml