Connecting Tech Pros Worldwide Forums | Help | Site Map

Do Browser's cache .JS files?

harry
Guest
 
Posts: n/a
#1: Jul 23 '05
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



Randy Webb
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Do Browser's cache .JS files?


harry wrote:
[color=blue]
> 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?
>[/color]

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/
harry
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Do Browser's cache .JS files?


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

"Randy Webb" <hikksnotathome@aol.com> wrote in message
news:F5-dnZYHg7ItVzndRVn-uw@comcast.com...[color=blue]
> harry wrote:
>[color=green]
> > 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[/color][/color]
of[color=blue][color=green]
> > my app regardless if they're used in this page & take a performance hit
> > once? - or am I missing something?
> >[/color]
>
> 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/[/color]


Randy Webb
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Do Browser's cache .JS files?


harry wrote:
[color=blue]
> Randy, the app is a Intranet program & users are likely to be viewing
> several (5+) pages per visit![/color]


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/
Grant Wagner
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Do Browser's cache .JS files?


harry wrote:
[color=blue]
> 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[/color]

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 <gwagner@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


Closed Thread


Similar JavaScript / Ajax / DHTML bytes