Mar articles related to web optimization
Unnecessary HTTP calls occur in Internet Explorer, but not in Firefox. In Internet Explorer, if an external script is included twice and is not cacheable, it generates two HTTP calls during page loading. Even if the script is cacheable, the extra requests occur when the user reloads the page.
A solution to avoid accidentally including the same script twice is to implement a script manager module in your template system. The most common way to include a script is by using the SCRIPT tag in your HTML page.
An alternative in php could be to create a function called "insertScript".
? php insertScript ("menu.js")?
In addition, to prevent the same script from being inserted multiple times, this function should handle other issues with scripts, such as adding the version number to the filename to support long-lived Expires headers.Date update on 2020-11-13. Date published on 2020-11-13. Category: Computer class Author: Oscar olg Fuente: tecnologia