Every page carries 8.5 kB of inline JavaScript that could be cached

Đang mở
#683 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

@guidol-ive đang làm issue này rồi.

Từ ngày 28/10/2026.

  • #686 của @guidol-ive — đang mở

Đánh giá

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

Hướng nghiên cứu

Read the JavaScript functions in events.php, tags.php, users.php, and bowser.php, then inspect how system/ assets are served and included. Check linked PR #686 before starting, since it is already open against this issue. Done means shared functions load from cached system/assets/hypha.js, tag functions are sent only to members, and behavior is unchanged apart from removing the IE6 fallback.

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

Mô tả

Impact: Low Level: Easy Type: Enhancement Value: Visitors

Problem

Every page carries about 8.5 kB of inline JavaScript (measured on the home page of a site with 1,000 pages, 70% of the 12 kB HTML). It is sent again with every page and cannot be cached by the browser or a CDN.

Part Size Needed
hypha(), ajax(), notify(), notifyTimer() (events.php) 4.0 kB on every page, but the same on every page
selectTag(), deselectTag(), newTag() (tags.php) 1.3 kB only for members, who can change tags
login(), reregister() (users.php) 2.5 kB for visitors; #645 replaces it by a page without JavaScript
showBrowserNotSupportedPopup() (bowser.php) 0.7 kB see #453

A large publisher sends its JavaScript as separate, cached files and keeps only small data blocks inline.

Inline scripts also stand in the way of a Content-Security-Policy for scripts without 'unsafe-inline' (#432, PR #671).

Expected

  • The functions that are the same on every page are in a static file, system/assets/hypha.js, which the browser caches (the system/ files are sent with Cache-Control: public, max-age=86400).
  • The tag functions are only sent to members.
  • Behaviour does not change. The fallback to ActiveXObject for Internet Explorer 6 can go: every browser since 2006 has XMLHttpRequest.
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.