This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple includes of the same .js file.Will it slow down the application?  RSS feed

 
Doshi Milan
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a scenario wherein 3 JSPs ( say header.jsp, footer.jsp and main.jsp) are including the same js file as under:
<script language="JavaScript" src="/js/mind.js" type="text/javascript"></script>.
Now the main.jsp also includes header.jsp and footer.jsp. Does it mean that the mind.js file is downloaded thrice when main.jsp is invoked ?
If YES, how do I avoid it as it needlessly slows down the application.
If NO, how do I prove it that it is not slowing down the application.( The client needs to be convinced vide some technical matter / website).
All help will be highly appreciated. I would also be very grateful if some URLs are given to me to prove my answer.
Thanks and regards,
Milan Doshi
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Downloaded JS scripts should be cached by the browser just like image and CSS files are. Thus using included rather than inline scripts should be substantially faster.
I suppose you could try to locate the script in the browser cache to prove this.
Bill
 
Doshi Milan
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Williams for your valued reply.
I would appreciate if yopu can further tell me how do I find the script in the Browser cache...
I know I may sound a bit weird but than thats one of the requirements of the clients. Even a URL / link of any authenticate articles on the internet would suffice my cause.
Thanks in advance,
Milan Doshi
[ October 15, 2002: Message edited by: Doshi Milan ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you are on a Windows system, you would have to locate the directory that the browser is using for cached resources and use the search facility to look for some character sequence that occurs in your JavaScript.
Some editors - such as UltraEdit - also have search in files capability.
Bill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!