melhorias de performance
This commit is contained in:
1 parent
ce851b9cf9
commit
63d5cbebe7
4 files changed
+59
-19
No files matched your search
@@ -20,12 +20,17 @@ const app = Fastify({ logger: true, trustProxy: true });
|
||||
|
||||
await app.register(cors, { origin: true });
|
||||
|
||||
// Cache-Control é decidido no nginx interno (ver nginx/nginx.conf,
|
||||
// location /models/), não aqui — "immutable"/maxAge nesse nível conflitava
|
||||
// com o "no-cache" que o nginx adiciona por cima (dois headers
|
||||
// Cache-Control na mesma resposta, comportamento indefinido entre
|
||||
// navegadores), e ia contra o motivo do "no-cache": os .glb têm nome fixo
|
||||
// mas o CONTEÚDO muda toda vez que o pipeline roda de novo.
|
||||
await app.register(fastifyStatic, {
|
||||
root: MODELS_DIR,
|
||||
prefix: "/models/",
|
||||
decorateReply: false,
|
||||
immutable: true,
|
||||
maxAge: "7d",
|
||||
etag: true,
|
||||
});
|
||||
|
||||
app.get("/api/health", async () => ({ status: "ok" }));
|
||||
|
||||
Reference in new issue
Block a user