Questions tagged [deferred-loading]

Use this tag for questions related to deferred loading of script, style and other resources into a web page.

98 questions
66
votes
8 answers

CSS delivery optimization: How to defer css loading?

I am trying to optimize the CSS delivery following the google documentation for developers https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery#example As you can see in the example of inlining a small CSS file the critical CSS in…
RafaSashi
  • 16,483
  • 8
  • 84
  • 94
56
votes
6 answers

DEFER or ASYNC allowed on a stylesheet include?

I know script files can use the DEFER and ASYNC keywords on a resource include. Do these keywords also work for stylesheet (i.e., CSS) includes? Syntax would presumably be:
Doug
  • 5,116
  • 10
  • 33
  • 42
42
votes
2 answers

Defer loading and parsing of PrimeFaces JavaScript files

While analyzing the performance of a JSF 2.1 + PrimeFaces 4.0 webapp with Google PageSpeed, it recommends among others to defer parsing of JavaScript files. On a test page with a and a form with and which…
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
38
votes
5 answers

Speed up page load by deferring images

I am creating a page which will contain a lot of large sized images, so naturally I want to make sure the page loads without too much trouble. I read this article here http://24ways.org/2010/speed-up-your-site-with-delayed-content The method of…
Huangism
  • 16,278
  • 7
  • 48
  • 74
30
votes
2 answers

Any good reason not to use // Larger file // Small file Though second in order…

Bradley Flood
  • 10,233
  • 3
  • 46
  • 43
13
votes
3 answers

Javascript non-blocking scripts, why don't simply put all scripts before tag?

In order to avoid javascript to block webpage rendering, can't we just put all all our JS files/code to be loaded/executed simply before the closing tag? All JS files and code would be downloaded and executed only after the all page has…
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
13
votes
2 answers

Do modules prevent the need to use the DOMContentLoaded listener?

document.addEventListener('DOMContentLoaded', () => { }); I read that this event listener made sure, for regular scripts, that the JS wasn't going to reference nodes that hadn't been loaded yet. The content executes after DOMContentLoaded has…
tonitone120
  • 1,920
  • 3
  • 8
  • 25
12
votes
1 answer

Forcing a checkbox bound to a DataSource to update when it has not been viewed yet

Here is a test framework to show what I am doing: create a new project add a tabbed control on tab 1 put a button on tab 2 put a check box paste this code for its code (use default names for controls) public partial class Form1 : Form { …
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
11
votes
2 answers

GWT: deferred loading of external JS resources

I have a widget depending on some external JS files, and I'd like to lazy load all these external resources. I've already used code splitting to lazy load the GWT code that concerns the widget, but the JS files defined in the gwt.xml, using the…
Ionuț G. Stan
  • 176,118
  • 18
  • 189
  • 202
10
votes
3 answers

How does DOMContentLoaded relate to Web Components?

It's age-old common sense to start manipulating the DOM only once it's ready and we can be certain all the elements are available, and in the post-jQuery days we're all using the DOMContentLoaded event for this. Now web components (especially in the…
connexo
  • 53,704
  • 14
  • 91
  • 128
9
votes
2 answers

Interaction between jQuery .ready() and