Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Ajax load may cause unnecessary network traffic #3726
$.mobile.loadPage uses the following code to pre-parse the HTML content loaded by an Ajax request:
This will cause all scripts ,css, etc., referenced by the <head> section in the HTML content, to be pre-loaded by the browser (though the browser won't actually execute or apply them until they are inserted into the document DOM tree). Since all scripts and css in the <head> section will be discarded later, these network traffics are obviously unnecessary.
Especially, for a script or css that is generated dynamically by the server (e.g., by respecting the user agent), the network traffic is absolutely not a simple 304 response code...
Maybe the page loading behavior can be improved by replacing the following lines in $.mobile.loadPage:
This comment has been minimized.
This comment has been minimized.Show comment Hide comment