Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
12.3-rc-1
-
Unknown
-
Description
Reproduction steps
- Log in as a user who has edit right on the page
- Visit http://localhost:8080/xwiki/bin/view/Sandbox/
- Open the browser debugger and make sure that "disable cache" is unchecked
- 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.
Attachments
Issue Links
- relates to
-
XWIKI-22935 tree.less is not cached
-
- Open
-
-
XWIKI-24841 In-place editing preloads the whole CKEditor in view mode
-
- Open
-