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

Đang mở
#701 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
5
Fork
9
Merge trung bình
18 giờ 49 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PlanBCode/hypha

Tất cả issue của PlanBCode/hypha

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.