468,244 Members | 2,021 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,244 developers. It's quick & easy.

Do Browser's cache .JS files?

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
4 10243
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
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
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
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.

Similar topics

1 post views Thread by GameDev | last post: by
1 post views Thread by Flyfish | last post: by
2 posts views Thread by Peter Row | last post: by
2 posts views Thread by Freddy | last post: by
6 posts views Thread by ernesto.tejeda | last post: by
1 post views Thread by Kfir Marouani | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.