镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Lazy js loading overview #36728

Closed
Closed

Activity

  1. self-assigned this
    on Feb 15, 2023
  2. pulsejet commented on May 17, 2023

    @pulsejet
    Member

    Maybe unrelated to this effort, but the viewer and unsupported browser scripts are loaded synchronously and are super slow. Do you want me to look into this @juliushaertl?

  3. juliusknorr commented on May 17, 2023

    @juliusknorr
    MemberAuthor

    Feel free to jump in on those topics, I don't really have much time to focus on this currently. Any contributions are welcome :)

  4. szaimen commented on May 20, 2023

    @szaimen
    Contributor

    Just wanting to point out that enabling gzip content-encoding in the webserver seems to make a huge difference in terms of transferred js file sizes. core-common.js is then for example reduced from 13.3 MB to 3.5 MB. Dashboard for example loads thus in almost half the time: 7.5s vs 12.5s before in my testing without browser cache (not the fastest network connection here).

    Maybe we should suggest this in the docs at least for js files or does this come with known downsides?

  5. szaimen commented on May 20, 2023

    @szaimen
    Contributor

    Brotli seems to look even better: reduces core-common.js down to 2.0 MB. I will enable this in AIO by default with nextcloud/all-in-one#2576 for js files.

  6. szaimen commented on May 20, 2023

    @szaimen
    Contributor

    btw, it looks like for some response content is by default gzip used. Is there a reason this could not be applied by Nextcloud by default for js assets?

  7. pulsejet commented on May 21, 2023

    @pulsejet
    Member

    Agree, serving JS without gzip is a disaster. I'd be a bit careful with brotli though. You can't compress brotli on the fly; that'll be too slow. The use-case for brotli is serving pre-compressed artifacats, so need to make sure that is the case.

  8. pulsejet commented on May 21, 2023

    @pulsejet
    Member

    We can't do anything about viewer here since it has some side effects (hooks), but lazy loading the components themselves seems to do the trick for performance. nextcloud/viewer#1675

  9. szaimen commented on May 22, 2023

    @szaimen
    Contributor

    I just tested this with the login page (time with new load in new private window until it shows login form) and these are the results:
    (manually tracked, so possible that they are not 100% correct but I did the test multiple times to confirm that they are not completely incorrect).

    ~4.12s loading time without compression
    ~2.76s loading time with Brotli
    ~3.34s loading time with Deflate
    

    So even on the fly Brotli seems to be the fastest :)

  10. removed their assignment
    on Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions