There is 1 update, 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-41857999-c0f2-4e8d-a9ae-25c2b2663213 XWIKI-24849 Open

9.7 KB of static RequireJS configuration is inlined in every page instead of being a cacheable skin file

 
View issue   ·   Add comment
 

1 update

 
cid:jira-generated-image-avatar-eef9a493-1ecd-4e34-8afd-9d53ff56bfb1 Changes by Manuel Leduc on 22/Sep/26 15:33
 
Assignee: Manuel Leduc
 
 

2 comments

 
cid:jira-generated-image-avatar-eef9a493-1ecd-4e34-8afd-9d53ff56bfb1 Manuel Leduc on 22/Sep/26 15:33
 

Draft pull request: https://github.com/xwiki/xwiki-platform/pull/6476

The static part of the configuration moves to a new js/xwiki/requireConfig.js skin file, served through the skin action with a 30-day expiry; only the ~800 bytes of page and user specific XWiki.* values stay inline.

Measured between two 18.9.0-SNAPSHOT builds (default flavor, guest, minification on):

  • the document goes from 73,164 to 62,759 bytes, i.e. -10,405 bytes (-14.2%) on every view
  • a repeat view transfers 8.8% fewer bytes; a first visit transfers the same total, the bytes simply moving into one extra cacheable request
  • on a warm view throttled to Fast 3G, FCP and LCP go from 792 ms to 756 ms and DOMContentLoaded from 776 ms to 731 ms; on a cold view the gain is not measurable, the page being 2.8 MB in total
  • server-side page generation goes from 132.6 ms to 129.0 ms

Two caveats worth recording: neither instance compresses its responses, so behind gzip the saving is about 2.1 KB per view rather than 10.4 KB (the same ~15% of the document); and the file actually served is the minified copy, since the skin resolver rewrites .js to .min.js when minification is on – checked that it evaluates and works.

 
cid:jira-generated-image-avatar-eef9a493-1ecd-4e34-8afd-9d53ff56bfb1 Manuel Leduc on 22/Sep/26 15:39
 
Draft pull request PR : [ https://github.com/xwiki/xwiki-platform/pull/6476

The static part of the configuration moves to a new {{js/xwiki/requireConfig.js}} skin file, served through the skin action with a 30-day expiry; only the ~800 bytes of page and user specific {{XWiki.*}} values stay inline.

Measured between two 18.9.0-SNAPSHOT builds (default flavor, guest, minification on):
* the document goes from 73,164 to 62,759 bytes, i.e. -10,405 bytes (-14.2%) on every view
* a repeat view transfers 8.8% fewer bytes; a first visit transfers the same total, the bytes simply moving into one extra cacheable request
* on a warm view throttled to Fast 3G, FCP and LCP go from 792 ms to 756 ms and DOMContentLoaded from 776 ms to 731 ms; on a cold view the gain is not measurable, the page being 2.8 MB in total
* server-side page generation goes from 132.6 ms to 129.0 ms

Two caveats worth recording: neither instance compresses its responses, so behind gzip the saving is about 2.1 KB per view rather than 10.4 KB (the same ~15% of the document); and the file actually served is the minified copy, since the skin resolver rewrites {{.js}} to {{.min.js}} when minification is on -- checked that it evaluates and works.
]