×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: script in header - better to remove?

script in header - better to remove? 12 years 6 months ago #14272

  • Brecht Coene
  • Brecht Coene's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0
I noticed the following script in my header:
 
 var COM_COMMENT_MSG_DELETE 	= "Weet u zeker dat u deze reactie 
....
This script potentially slows down the site, because it is loaded for each page. Can it be removed? or be put in a script file so we can cache it?

script in header - better to remove? 12 years 6 months ago #14273

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
You can try to optimize this, by putting the language translations in a separate file.
The function responsible for outputing the language strings to the head is located in
components/com_comment/classes/joscomment/JOSC_jscript.php

you can comment all language translations and put them in a file that you load together with the component.
However to be honest I doubt how beneficial such operation is going to be. All the translation text is perhaps 1kb and putting this in a separate file will mean additional http request to fetch the file... (true it is going to be cached after that) But you can decide for yourself.

Daniel
  • Page:
  • 1
Time to create page: 0.118 seconds