By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,665 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,665 IT Pros & Developers. It's quick & easy.

Do Browser's cache .JS files?

P: n/a
Using IE 5.5(sp2) no other!

I have several .js files that are included in various jsp pages.

I've read somewhere(can't remember where?) that the browser caches .js
files.

If this is the case is it better to include all of them in the 1st page of
my app regardless if they're used in this page & take a performance hit
once? - or am I missing something?

thanks

harry
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
harry wrote:
Using IE 5.5(sp2) no other!

I have several .js files that are included in various jsp pages.

I've read somewhere(can't remember where?) that the browser caches .js
files.

If this is the case is it better to include all of them in the 1st page of
my app regardless if they're used in this page & take a performance hit
once? - or am I missing something?


Load the page. Look in your cache folders. If there are .js files there,
it caches them, if there aren't, then it doesn't. Pretty easy to test.

And while loading them all on the first page might have its advantages
by speeding up subsequent pages, its a disadvantage as well. Why should
I, as a user, have to sit through a download (performance hit) so that I
can see 1 or 2 pages, yet have to download the .js for the entire site?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

P: n/a
Randy, the app is a Intranet program & users are likely to be viewing
several (5+) pages per visit!

"Randy Webb" <hi************@aol.com> wrote in message
news:F5********************@comcast.com...
harry wrote:
Using IE 5.5(sp2) no other!

I have several .js files that are included in various jsp pages.

I've read somewhere(can't remember where?) that the browser caches .js
files.

If this is the case is it better to include all of them in the 1st page of my app regardless if they're used in this page & take a performance hit
once? - or am I missing something?


Load the page. Look in your cache folders. If there are .js files there,
it caches them, if there aren't, then it doesn't. Pretty easy to test.

And while loading them all on the first page might have its advantages
by speeding up subsequent pages, its a disadvantage as well. Why should
I, as a user, have to sit through a download (performance hit) so that I
can see 1 or 2 pages, yet have to download the .js for the entire site?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #3

P: n/a
harry wrote:
Randy, the app is a Intranet program & users are likely to be viewing
several (5+) pages per visit!

The FAQ is in my signature, you should read it until you understand it.

As for your question, it depends on how the users cache settings are set.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #4

P: n/a
harry wrote:
Using IE 5.5(sp2) no other!

I have several .js files that are included in various jsp pages.

I've read somewhere(can't remember where?) that the browser caches .js
files.

If this is the case is it better to include all of them in the 1st page of
my app regardless if they're used in this page & take a performance hit
once? - or am I missing something?

thanks

harry


Unless you are using the IEAK to lock down the settings your user community
can change, the browser caching behaviour is controlled by the user of the
browser. In Internet Explorer 5.5 Service Pack 2, go to Tools -> Internet
Options -> Settings... -> General tab -> the radio select under "Check for
newer versions of stored pages" controls when and how the browser caches
documents.

Caching behaviour can also be controlled by headers sent from the server, but
I would imagine that's not an issue (unless you've got your Web server
configured to tell browsers to never cache files ending in .js).

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.