1
Venezia
How to save 10K on each Xoops page
  • 2003/9/26 8:12

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Not sure if this has been asked before. Couldn't find it.

Suggestion: XOOPS pages have about 10k of javascript in the header. Would it be more efficient to scoop up all this javascript and put it in a separate js file. Most browsers cache documents so the js file would not be downloaded each time a page was called. Each XOOPS page would have a saving of about 10k. Also admins could compact this file using various freely available tools to make the js file even smaller.

Q. Is the js generated for the theme.html header "standard" or does it change from page to page according to modules being used?

Ideas anyone?

Venezia

2
Xend
Re: How to save 10K on each Xoops page
  • 2003/9/26 9:10

  • Xend

  • Friend of XOOPS

  • Posts: 37

  • Since: 2001/12/13


I have alredy done that at http://www.xoops.no , only for testing, cant say i have run into any problem, but remember, you nead to get javascript from your ovn site, because of language and url's in the script.

I will not tell howto, because i think its best to leave it as it is..


3
costi
Re: How to save 10K on each Xoops page
  • 2003/9/26 12:50

  • costi

  • Just popping in

  • Posts: 15

  • Since: 2003/9/12


I looked at your site and I wanted to do the same to mine. So I went to the file include/xoopsjs.php and cut all static content into themes/default/static.js. So far I saved 4k!
http://trubadur.usr.ro/themes/default/static.js

Take a look at what's left:
http://trubadur.usr.ro/

I think I did a very clean hack, can work for everybody, and if you change the language, it still works.



4
costi
Re: How to save 10K on each Xoops page
  • 2003/9/26 12:56

  • costi

  • Just popping in

  • Posts: 15

  • Since: 2003/9/12


This is what's left of include/xoopsjs.php, if you want to try it for yourselves. The file static.js is hyperlinked in my previous post.

Edite by costi 8-nov-2003

5
onokazu
Re: How to save 10K on each Xoops page
  • 2003/9/26 14:29

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


All javascript codes are moved to include/xoops.js now on CVS, and will use
6
Rou4cn
Re: How to save 10K on each Xoops page
  • 2003/10/8 15:59

  • Rou4cn

  • Just popping in

  • Posts: 16

  • Since: 2003/5/3 1


But nothing changed for it in Xoops2.0.5 yet. right?

I must still be waiting a more fast xoops.

according to discussion in cn.xoops.org, there are 3 point may improve:
1, every module use cache, but the forum will be ?
2, Learn from IPB, save something like Uid into session or cache, reduce more "SELECT * FROM xoops2_config WHERE (conf_modid = 0 AND conf_catid = 1) ORDER BY conf_order ASC"
3, the js.

the links:
http://www.hiweed.com/xoops/modules/newbb/viewtopic.php?topic_id=1519&forum=8

http://www.hiweed.com/xoops/modules/newbb/viewtopic.php?topic_id=1511&forum=8

http://www.hiweed.com/xoops/modules/newbb/viewtopic.php?topic_id=1672&forum=5

but nothing in Xoops2.0.5!


7
onokazu
Re: How to save 10K on each Xoops page
  • 2003/10/8 16:06

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


It did change in 2.0.5. Take a look at the source code of this site. There are extra tags but they were needed for theme compatibility.

8
hatch
Re: How to save 10K on each Xoops page
  • 2003/10/8 19:03

  • hatch

  • Just popping in

  • Posts: 2

  • Since: 2003/9/9 2


Very cool! I like 2.0.5

9
costi
Re: How to save 10K on each Xoops page
  • 2003/10/8 19:36

  • costi

  • Just popping in

  • Posts: 15

  • Since: 2003/9/12


But it's locked in the english language. Why don't put static js in a file and js code with php language constants embedded in the main html?

What about the people with sites other than in english?

10
onokazu
Re: How to save 10K on each Xoops page
  • 2003/10/9 1:15

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


No the phrases change fine with other languages. The phrases hardcoded in the .js file are for old codes that don't pass the phrases as javascript parameters (which were added from 2.0.5) so that old codes will not produce javascript errors.

Login

Who's Online

229 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits