Loading

Author Topic: To themes developers: combine .js and .css files to make OSClass load faster  (Read 1175 times)

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 1922
To all theme developers out there, a small tip making your theme load a little faster. Whole explanation at the wiki : http://wiki.osclass.org/index.php/Combine_.js_and_.css_files_to_make_OSClass_load_faster


Any doubts or question could be placed here.

bilekas

  • Full Member
  • ***
  • Posts: 210
  • Bilekas
    • Bilekas
This is good, i must say it increases load speed but also codding speed, including extra javascript and css files is a lot more simple!

Only issue would be we would use chrome developer extensions and locating a certain line in JS and CSS is now a little harder as its always bring up the wrong line number ! :) But apart from this its perfect!

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 1922
Hi bilekas,

That could be a problem, but it could be done in the last step, once the theme is finished...

I think that also Chrome offer you he possibility to "follow" the code, If you click or doubleclick on the error, it send you directly to that line of code (on the combined file) which doesn't solve the issue but could help you know the real location of it.
This also happen if you use "minified" versions of the scripts...

RajaSekar

  • Hero Member
  • *****
  • Posts: 672
  • ராஜசேகர்
    • Rajclassifieds
    • Email

@_CONEJO

combine.php is not working on my website

i tried this code

<script type="text/javascript" src="<?php echo osc_current_web_theme_url('combine.php?type=js&files=js/jquery.js,js/jquery-ui.js,js/jquery.uniform.js,js/global.js,js/tabber-minimized.js') ; ?>"></script>

works well on localhost but not working on hosted website

any help

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 1922
What is the exact problem?

It could be that your folder is not writable or you don't have enough permission to write the file

RajaSekar

  • Hero Member
  • *****
  • Posts: 672
  • ராஜசேகர்
    • Rajclassifieds
    • Email

@_CONEJO

its my host  htaccess problem

i have just moved the css,js,combine.php to oc-content/js-css now it works

Cynocloud

  • Newbie
  • *
  • Posts: 1
    • Email
Hi. I have gone through this link http://wiki.osclass.org/index.php/Combine_.js_and_.css_files_to_make_OSClass_load_faster but I would like to know whether there is a step by step tutorial about this. If there is one, please direct me to it or if there isn't, I hope someone will be kind enough to share.

ola

  • Newbie
  • *
  • Posts: 2
    • Email
Hi,
I am just learning PHP, will someone pls tell me where to put this bellow codes, which file?
Should I add the bellow line in each and every PHP file?

Quote
For CSS loading:

<link href="<?php echo osc_current_web_theme_url('combine.php?type=css&files=css/style.css,css/tabs.css') ; ?>" rel="stylesheet" type="text/css" />


For JS loading:

<script type="text/javascript" src="<?php echo osc_current_web_theme_url('combine.php?type=js&files=js/jquery.js,js/jquery-ui.js,js/jquery.uniform.js,js/global.js,js/tabber-minimized.js') ; ?>"></script>



appreciate in advance
« Last Edit: Today at 12:08:29 pm by ola »