Skip to content

Conversation

rldhont
Copy link
Collaborator

@rldhont rldhont commented Mar 7, 2025

Documentation about preload link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload

  • Add preload for CSS and JS files added to the HTML pages
  • Add preload for fetch request in Map pages

@github-actions github-actions bot added this to the 3.10.0 milestone Mar 7, 2025
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from 2265b8c to 38e13ec Compare March 7, 2025 09:48
@rldhont rldhont marked this pull request as ready for review March 7, 2025 09:49
@nboisteault
Copy link
Member

I'm not sure but it might block the HTML rendering.
It would be interesting to test against lighthouse to see if it improves its score.

@josemvm
Copy link
Collaborator

josemvm commented Mar 7, 2025

hi @rldhont
sorry, i don't know if the problem is related to this issue, but in lwc 3.8 there is a strong and visible delay in loading project images after cleanning the lizmap cache

@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from 38e13ec to a198ef7 Compare March 7, 2025 10:38
@rldhont
Copy link
Collaborator Author

rldhont commented Mar 7, 2025

I'm not sure but it might block the HTML rendering. It would be interesting to test against lighthouse to see if it improves its score.

From https://stackoverflow.com/questions/36641137/how-exactly-does-link-rel-preload-work

For example, the application can use the preload keyword to initiate early, high-priority, and non-render-blocking fetch of a CSS resource that can then be applied by the application at appropriate time:

@rldhont
Copy link
Collaborator Author

rldhont commented Mar 7, 2025

@nboisteault according to mdn, preload should not blocked the page

The preload value of the element's rel attribute lets you declare fetch requests in the HTML's , specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in. This ensures they are available earlier and are less likely to block the page's render, improving performance. Even though the name contains the term load, it doesn't load and execute the script but only schedules it to be downloaded and cached with a higher priority.

@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from a198ef7 to 0d91bf9 Compare March 7, 2025 11:25
{
protected $CSPPropName = 'mapCSPHeader';

protected function outputJsScriptTag($fileUrl, $scriptParams)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions will implicitly add a preload tag for each resource loaded with addJSLink/addCssLink, no ?

@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch 2 times, most recently from 23750aa to b24ccb5 Compare March 7, 2025 14:56
@rldhont rldhont marked this pull request as draft March 7, 2025 18:58
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from b24ccb5 to d7b52cd Compare May 6, 2025 15:34
@Gustry Gustry modified the milestones: 3.10.0, 3.11.0 Jun 23, 2025
Copy link

The Lizmap project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 2 months and is being automatically marked as "stale".
If there is no further activity on this pull request, it will be closed in two weeks.

@github-actions github-actions bot added the stale This ticket might be closed soon label Aug 27, 2025
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from d7b52cd to 59913be Compare August 28, 2025 19:00
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from 59913be to 758684f Compare August 28, 2025 20:14
@github-actions github-actions bot removed the stale This ticket might be closed soon label Aug 29, 2025
@rldhont rldhont marked this pull request as ready for review August 30, 2025 15:35
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from d268b4b to 9ec807a Compare September 1, 2025 08:14
@Gustry Gustry removed their request for review September 10, 2025 12:32
@rldhont rldhont force-pushed the speedup-lizmap-preload-link branch from 9ec807a to bec60f2 Compare October 9, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release_3_10 php Pull requests that update Php code user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants