kevind
Posts: 251
|
| Posted: 11/13/2008, 8:39 AM |
|
I'm trying to reduce page load times by not repeating content in pages - like scripts.
I have a main page which loads content into IFRAMEs - the main page includes JQuery.js and then the pages loaded into the IFrames also load JQuery for functions that are called on those pages.
Is there any way to cache the JQuery js file so that the main page and the pages loaded in IFRAMEs all refer to this 1 include , reducing extra 'loads' substantially?
If the above does not apply - can someone tell me if the browsers tend to do this automatically anyway .
thanks,
Kevin
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
melvyn
Posts: 333
|
| Posted: 11/13/2008, 9:03 AM |
|
If you only have 1 instance of JQuery, let's say it's located in http://www.yoursite.com/scripts/jquery.js and all your files are pointing there (iframes or not) then your JQuery file will be cached by the browser and downloaded only once.
Also, you can avoid the iframe by using the JQuery load function in the main page:
Instead of using:
<div id="frame1-here">
<iframe src="http://www.youriste.com/frame1.html">
</div>
You can use an empty div like this:
<div id="frame1-here">
<div>
And load the framed content using JQuery as:
$("#frame1-here").load(http://www.youriste.com/frame1.html);
or:
$("#frame1-here").html(http://www.youriste.com/frame1.html);
That's get the same as the iframe, using jquery and being indexed by search engine.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
kevind
Posts: 251
|
| Posted: 11/13/2008, 11:58 AM |
|
thanks for the technical details - i'll have to complain about performance with the hosting company then.
yes, i already use jquery to load the frames interactively from the user clicks
as for indexing, it's a private web app. so it doesn't apply.
thanks again for the info.
Kevin
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
|