Gestione della cache su readmodel

Come sviluppatore vorrei implementare un sistema di cache sul readmodel (directus) in modo da migliorare le performance generali

Test

  • la chiamata alle api dell'ambiente di qa deve restituire header di cache o stato http conformi a una configurazione cache attiva (esempio https://readmodel-qa.boat.opencontent.io/items/tenants )

Esempio: vedi header di risposta x-cache: HIT in

curl -v ``https://readmodel-qa.boat.opencontent.io/items/tenants

* Host readmodel-qa.boat.opencontent.io:443 was resolved.
* IPv6: (none)
* IPv4: 63.35.34.67
*   Trying 63.35.34.67:443...
* Connected to readmodel-qa.boat.opencontent.io (63.35.34.67) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=boat.opencontent.io
*  start date: Nov 28 15:09:13 2025 GMT
*  expire date: Feb 26 15:09:12 2026 GMT
*  subjectAltName: host "readmodel-qa.boat.opencontent.io" matched cert's "*.boat.opencontent.io"
*  issuer: C=US; O=Let's Encrypt; CN=R12
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://readmodel-qa.boat.opencontent.io/items/tenants
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: readmodel-qa.boat.opencontent.io]
* [HTTP/2] [1] [:path: /items/tenants]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
> GET /items/tenants HTTP/2
> Host: readmodel-qa.boat.opencontent.io
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/2 200
< access-control-allow-credentials: true
< access-control-expose-headers: Content-Range
< cache-control: no-cache
< content-security-policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob: https://raw.githubusercontent.com https://avatars.githubusercontent.com;media-src 'self';connect-src 'self' https://* wss://*;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
< content-type: application/json; charset=utf-8
< date: Mon, 29 Dec 2025 08:26:46 GMT
< etag: W/"1ea-moKcmi52kUCJ9o613Gor8OeJAuk"
< vary: Origin, Cache-Control
< x-cache: HIT
< x-powered-by: Directus
< content-length: 490
<
* Connection #0 to host readmodel-qa.boat.opencontent.io left intact
Edited Dec 29, 2025 by Luca Realdi
Assignee Loading
Time tracking Loading