Giter VIP home page Giter VIP logo

Comments (12)

vigneshshanmugam avatar vigneshshanmugam commented on September 15, 2024 2

@mo-gr Yes we do need to wait, But we can use the Link headers and make the assets discoverable..

Link: "<assets.js>"; rel="preload", "<assets.css>";  rel="preload"

By this way the resources would be early discoverable and when the require.js kicks in and request's for the primary fragment JS asset, The resource would be available immediately which helps in interacting with the page quicker than before

Savings == Download + parsing time to fragment.js

should have explained a bit more in the proposal :)

from tailor.

addityasingh avatar addityasingh commented on September 15, 2024

@vigneshshanmugam Do you mean to preload only primary fragment's assets? And load the rest fragment's assets using AMD?

from tailor.

vigneshshanmugam avatar vigneshshanmugam commented on September 15, 2024

Preload assets till primary fragment is what I was thinking of, But need to test it under different scenarios and find out though.

from tailor.

mo-gr avatar mo-gr commented on September 15, 2024

Maybe I have a bit of a misunderstanding here... But how do you make the browser preload anything while waiting for the response of the primary fragment? While waiting for the primary, you can't send any headers to the browser because we have to wait for the status code, right?

from tailor.

mo-gr avatar mo-gr commented on September 15, 2024

Got it. That sounds like free lunch. It costs us virtually nothing to implement this feature, older browsers will just ignore it and newer ones will have improved performance. I love it!

from tailor.

vigneshshanmugam avatar vigneshshanmugam commented on September 15, 2024

@mo-gr :D ofcourse thats the beauty

from tailor.

addityasingh avatar addityasingh commented on September 15, 2024

@vigneshshanmugam This is really great and elegant solution 👍

from tailor.

vigneshshanmugam avatar vigneshshanmugam commented on September 15, 2024

Tested the MVP internally on our existing Product pages with a local proxy to Skipper.

Scenario

  • Average of 4 runs
  • Nexus emulation mode
  • Network Throttling - 150ms RTT
Metric First Meaningful Paint Mosaic Interactive(Custom)
Without Preload 1107 4137
With Preload 1098 3184

Result seems promising,Pretty clear that Primary fragments are given priority. Going ahead with the addition /cc @dazld @grassator @mo-gr

from tailor.

sylvesteraswin avatar sylvesteraswin commented on September 15, 2024

@vigneshshanmugam since the feature is supported only available in chrome 50+ how will this help in almost the other 50% of the devices? https://en.wikipedia.org/wiki/Usage_share_of_web_browsers

Keeping future proofing out of the way.

from tailor.

addityasingh avatar addityasingh commented on September 15, 2024

@sylvesteraswin But I think this still is a lot of gain for very small effort. For rest of the devices there could be another approach, but will definitely not be this concise and easy to implement.

Additionally for most of the applications, the percentage of the browser share will probably be not same as https://en.wikipedia.org/wiki/Usage_share_of_web_browsers. So this seems a quick win. Thoughts?

from tailor.

vigneshshanmugam avatar vigneshshanmugam commented on September 15, 2024

@sylvesteraswin Yes for now the preloading is only available in Chrome and Safari tech preview.. Other browsers are also implementing this feature and its totally future proof.

We are also thinking of how to support the same technique for older browsers though.. Will come up with a plan and discuss link here.

from tailor.

sylvesteraswin avatar sylvesteraswin commented on September 15, 2024

@addityasingh If most of the customers are not on latest version of chrome(which is mostly the case for mobile users) then this would become irrelevant and only be helpful to users who are on the latest platform. 🗡

But as @vigneshshanmugam pointed out, if we can figure out a way for this to be backward compatible then we can huge impact on users.

But all-in-all our future is secure 💃

from tailor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.