PDA

View Full Version : How To Stop JS Include File Download


JoeP
08-07-2003, 08:54 PM
I have a random quote script that reads an external .js file for each quote. The .js file is very large, and when a user opens the html page the file downloads to the client side harddrive. It causes a severe time lag on the loading of the page.

Does the .js file have to download? Can it be accessed on the server, in order to prevent the download time? I have tried no-cache approaches, but to no avail.

TIA For Any suggestions or advice.

Vladdy
08-07-2003, 08:57 PM
Use server side language for this functionality

whammy
08-08-2003, 12:46 AM
Yeah, you could just store quotes in a database, and then pick a random number server-side from the total number of quotes in the database, and select that number from the primary key field (which would already be indexed).

That should speed it up immensely. Not to mention your whole library of quotes won't be downloaded to the client's computer - although I'm sure they're not all yours, you did take the time to compile them into a library that you like. ;)