Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nitin Dubey
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic