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

Open
#683 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@guidol-ive is already working on this.

Since Oct 28, 2026.

  • #686 by @guidol-ive — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript

Research direction

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.

Written by the indexing model from the issue text.

Description

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.
Dominant language
JavaScript
Stars
5
Forks
9
Avg merge
18h 49m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PlanBCode/hypha

All issues in PlanBCode/hypha

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.