Closed Thread Icon

Topic awaiting preservation: How to cache js files? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8686" title="Pages that link to Topic awaiting preservation: How to cache js files? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: How to cache js files? <span class="small">(Page 1 of 1)</span>\

 
Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-03-2003 07:43

This is my html content structure:

content: 18k
Top navigator : 14k
Side Navigator (DHTML): 90k

I have tried to placed the top navigator and side navigator into seperate files and referencing them in HTML using:

<script langauge=javascript src=topnav.js></script>
<script langauge=javascript src=sidenav.js></script>

I can see that these two files in the IE 6 temporary internet folder.

My objective is to increase the performance of the page. The side navigator and top navigator is placing a big overhaed on the content.

How can I increate the performance so that the two .js file will not be loaded each time ?

Thank you.

Regards,
Pimms

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-03-2003 07:51
quote:
How can I increate the performance so that the two .js file will not be loaded each time ?



For them to not be loaded you'd need to remove them form the site completly, which means you menu wouldn't work. However, the advantage of using external .js files is that they're only loaded from the server the first time. On each other page the browser ~should~ fetch the .js files form the browser cache. This all happens automagically so you don't need to do anything special to make it happen.

Although, 90k for javascript menus? That seems really really excessive. I honestly can't see how you could need 90k just for javascript. Are you using the same script twice?, 2x45k I can understand, even still if you are using the same script twice then you can probably make some alterations so you can have both menus running of just one script.

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 06-03-2003 11:14

Heh, That must indeed be a hell of a menu .
If you *really* need that menu though, you could use Eddie Traversa's iframe-trick to load external content(www.dhtmlnirvana.com => "external content loader")

Also, you might want to use a js-cruncher to compress the code, thus reducing the file size. If you choose to do so, however, don't forget to make a copy of the original js-file, since the code will probablly be unreadible after a good crunch .

Finally, if nothing else works, let's see if we can make a 20-liner out of that script :P

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-04-2003 01:23

Thank you. I shall give it a good try.

« BackwardsOnwards »

Show Forum Drop Down Menu