Skip to content

Return 404 for missing static files instead of the app shell [skip deploy] #no-deploy - #21

Merged
SebastianLopezO merged 1 commit into
mainfrom
quality/lighthouse/soft-404-static-files
Nov 1, 2026
Merged

SebastianLopezO merged 1 commit into
mainfrom
quality/lighthouse/soft-404-static-files

Conversation

@SebastianLopezO

Copy link
Copy Markdown
Member

Caso

  • Origen: Lighthouse (agentic browsing) y revisión de nginx.
  • Problema: try_files $uri $uri/ /index.html respondía 200 con la app para cualquier archivo inexistente
    (/llms.txt, /assets/no-existe.js): un soft 404 para los rastreadores y un riesgo de que el service worker
    guarde HTML como si fuera un recurso.

Cambio

  • Las rutas con extensión responden 404 si el archivo no existe; las rutas de la app, sin extensión, siguen
    sirviendo index.html.
  • /assets/ pasa a ^~ para conservar su caché inmutable frente a la nueva expresión regular.

Verificación

  • En la demo beta: /llms.txt y /assets/nope.js → 404, /app/crops → 200, /robots.txt y /favicon.svg → 200 y
    los recursos de /assets/ mantienen Cache-Control: public, max-age=31536000, immutable.
  • Lighthouse móvil: agentic browsing pasa de 50 a 100.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@SebastianLopezO
SebastianLopezO merged commit c872e6a into main Nov 1, 2026
7 of 8 checks passed
@SebastianLopezO
SebastianLopezO deleted the quality/lighthouse/soft-404-static-files branch November 1, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant