Every page carries 8.5 kB of inline JavaScript that could be cached
Maintainers usually reply within 1 day
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
- Domain
- backend, performance
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
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 (thesystem/files are sent withCache-Control: public, max-age=86400). - The tag functions are only sent to members.
- Behaviour does not change. The fallback to
ActiveXObjectfor Internet Explorer 6 can go: every browser since 2006 hasXMLHttpRequest.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
PlanBCode/hypha#586 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
[vika] console keeps a stale "in progress" turn after a daemon restart mid-runPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
volcengine/OpenViking#7011 ·
Maintainers usually reply within 1 day
-
Issue: ready for confirmation Reported on 2.4.9 Triage: Dev.Experience
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
magento/magento2#41773 · 1 comment ·
Maintainers usually reply within 5 days
-
Upgrade listener stays on a custom server after close when `preClose` is setPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fastify/fastify-websocket#388 ·
-
[推荐] 影夕视频Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Perl - Readme DriftPossibly taken @Omnideth claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CommunityToolkit/Aspire#2375 ·
Maintainers usually reply within 2 days