I am currently making a sort of web app and part of it works by dynamically loading and adding js scripts to the page. For this I am using JQuery's $.getScript() method which loads it in.
I have it set as cached.
With my program if a script already exists it is loaded again anyway, from what appears to be cache. What I am wondering though is how much would this effect the site and performance. Does a newly loaded script that has the same src as an existing one overwrite the previous one or is the new one added alongside the old one?
Further more as my site is an AJAX site its possible for several scripts from different pages to eventually be loaded up over time. Is there any browser restrictions on how many scripts one can have loaded?
scriptincludes, you have other problems. If your real concern is that you may make several extraneous calls to load the same script, you should address that by other means (such as checking if the file is already included before requesting).$(document).ready()that you need to refire? If you literally just need to rerun that code block, create a function to attach it to the$(document).ready()so you can call it when you need it, or I suppose I don't understand the problem.