Understand lossless-ui caching and proxying behavior
mainWhen developing with or extending lossless-ui, be aware of the following architectural behaviors:
API Proxying
To avoid CORS errors, some requests are proxied through the first-party SvelteKit route at /api/proxy. This allows the browser to communicate with the API directly through the application server.
Caching Rules
The application implements a caching mechanism for safe GET requests. However, certain conditions prevent a response from being cached:
- Headers: Requests containing
Authorization,Cookie, orRangeheaders are not cached. - Payload Size: Responses larger than the
REDIS_CACHE_MAX_BODY_BYTESlimit are not cached. - Content Type: Non-text/JSON payloads are never cached.
- Status Codes: Any
4xxor5xxstatus codes are not cached. - Cache Control: Responses with
Cache-Control: no-storeorCache-Control: privateare never cached.