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

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

I maintainer di solito rispondono entro 1 giorno

@guidol-ive ci sta già lavorando.

Dal 28/10/2026.

  • #686 di @guidol-ive — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

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.

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

Descrizione

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.
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.