4 ms·
Push has its use cases. It has its distinct drawbacks as well. Consider the scenario when you want to lazy-load a script based on a user action so you're not ag
by jhabdas 9y ago
Push has its use cases. It has its distinct drawbacks as well. Consider the scenario when you want to lazy-load a script based on a user action so you're not aggressively loading things the user might not need. You may also enjoy: https://www.smashingmagazine.com/2017/04/guide-http2-server-push/ https://www.smashingmagazine.com/2017/04/guide-http2-server-...
- z3t4 9y agoIt's up to the browser to optimize. What I've discovered so far is that push has low priority and that if a script is required while it's being downloaded (pushed), the browser (chrome) downloads it twice. The browser could however be smart about it and just make the required script top priority and only download it once. The browser could also parse the pushed scripts (chrome currently doesn't) if the cpu is idle. This opens up for modules on the web, like in Node.JS, but without the latency penalty. Also there is no need for the browser to pre-parse the scripts to look for modules when they are already pushed.