wood burning stoves 2.0*
The moose likes Servlets and the fly likes Its a basic question but I have no idea ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Its a basic question but I have no idea ..." Watch "Its a basic question but I have no idea ..." New topic
Author

Its a basic question but I have no idea ...

Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

Hello folks,
Nice to see u reading the post. I m developing a website using JSP's. I wrote all the generalised javascript functions that I need in a seperate .js file. Later I realised that the size of this .js file has increased and this will eat up speed.
I want to confirm the browser's behavious regarding downloading .js files. There are two aspects.
1. The browser downloades the file every time u visit the page.
2. The browser downloads the file only once at the first time. And later the file is served through its cache.
Waiting for replies..

nitz
------------------
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Better question for the HTML/Javascript forum, but the browser (in general) will cache it. The behaviour is a little different in each, but I had a hell of a time getting IE to let a .js file go when I was developing...
Dave.
Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126

Hello Mr. David,
first of all thanx for your reply. In my case the .js file has grown up to 14kb and as you know speed is the main factor in web environment I want to go for an better option.
I would request the moderator to shift this topic to javascript forum.
Thanx
nitin
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

In the mean time...
If the file is 14k but is only downloaded once for the entire user visit, I wouldn't consider this excessive. I've seen sites with 200k+ js files...
Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Its a basic question but I have no idea ...
 
Similar Threads
Javascript file loading
A basic problem
internationalization for japanese text
GWT Questions
serialisation