This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-c9c13708-0007-4936-8d9a-3a9d6e6f08f9 XWIKI-24840 Open

tree.min.css is requested twice on every page view for a logged-in user

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-a9cf05bb-229e-461d-8783-50f89d31528e Manuel Leduc created this issue on 09/Sep/26 12:15
 
Summary: tree.min.css is requested twice on every page view for a logged-in user
Issue Type: cid:jira-generated-image-avatar-c9c13708-0007-4936-8d9a-3a9d6e6f08f9 Bug
Affects Versions: 12.3-rc-1
Assignee: Unassigned
Components: Tree
Created: 09/Sep/26 12:15
Priority: cid:jira-generated-image-static-major-7a2b0b8a-ad64-409f-be63-55a8f10fb18d Major
Reporter: Manuel Leduc
Description:

Reproduction steps

  1. Log in as a user who has edit right on the page
  2. Visit http://localhost:8080/xwiki/bin/view/Sandbox/
  3. Open the browser debugger and make sure that "disable cache" is unchecked
  4. Click on the "Sandbox Test Page 1" link and observe the network tab

Expected

tree.min.css?evaluate=true is requested at most once per page view.

Actual

It is requested twice, and since it is served with Expires: Thu, 01 Jan 1970 00:00:00 GMT neither response can be reused. That is 2 × 30.6 KB = 62 KB transferred on every single page view.

For comparison, the total amount transferred on a warm-cache page view is about 87 KB, so this one stylesheet accounts for roughly 70% of it.

A guest requests it only once, which is the clue to the cause.

Analysis

The two requests have different initiators:

  • the <link> emitted in the page itself, for the tree used by the Navigation panel and by the export tree modal;
  • a second one injected from JavaScript by CKEditor/InlineEditor, which is loaded in view mode by the in-place editing preload (see the companion issue about that preload).

Hence the difference between a guest and a user with edit right.

Note that the fact this stylesheet is not cacheable at all is a separate, already reported problem: XWIKI-22935. The two issues compound each other — the duplication only costs bandwidth on every page view because the response cannot be cached — but they can be fixed independently.

Suggested fix

Avoid the second injection when the stylesheet is already present in the page. Fixing the in-place editing preload so that CKEditor is not loaded in view mode at all also removes this second request as a side effect.

 
 

1 update

 
cid:jira-generated-image-avatar-a9cf05bb-229e-461d-8783-50f89d31528e Changes by Manuel Leduc on 09/Sep/26 12:18
 
Labels: performance