/llms.txt reads every page on each request: no cache as for the sitemap

Aperta
#701 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
performance

Direzione di ricerca

Start by reading the existing /sitemap.xml cache path, especially hypha_getSitemapEntries() and hypha_getSitemapLastModified(), then trace the /llms.txt builder from issue #680. Add cache handling for the summary and lines in data/llms.cache, keyed by the root URL, and keep translated headings per request. Done means /llms.txt reuses cached page data and refreshes it when the cache key changes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Impact: Medium Level: Easy Type: Enhancement Value: Security Value: Visitors

/llms.txt (#680) reads every public page on each request: hypha_getSitemapLastModified() loads the file of every text page and article, and every article is loaded a second time for its title and excerpt. /sitemap.xml reads the same files, but keeps its entries in data/sitemap.cache until hypha.xml or a page changes; /llms.txt has no cache.

A load test against a test copy of a site with about 1,200 public pages, 20 seconds at 40 concurrent requests:

Address Requests/s
/sitemap.xml (cached) 95
a text page 79
/llms.txt 3.9 (p95 about 9 s)

So a handful of clients asking for /llms.txt, as AI crawlers do, keeps the server busy (see also #411).

Fix: hypha_getSitemapCached() takes the cache logic of hypha_getSitemapEntries() (key: the times of hypha.xml and data/pages), for any build function. /llms.txt keeps its summary and lines in data/llms.cache, with the root URL in the key; the translated headings are added per request.

🤖 Generated with Claude Code

Lingua principale
JavaScript
Stelle
5
Fork
9
Merge medio
18h 49m
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PlanBCode/hypha

Tutte le issue di PlanBCode/hypha

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.