0
votes

I am using the SmartOptimizer(previously named as JSmart) PHP library to improve my site performance. This library will enhance our website performance by minifying, compressing, concatenating, and caching the JS and CSS files used in our website. You can check the details of this library here.

I want to use the concatenation feature of this library, but I don't find any good example for using that feature for my website.

My CSS files are added like this:

'link rel="stylesheet" href="slider.css" type="text/css" media="screen" /'
'link href="section.css" rel="stylesheet" type="text/css" media="all" /'
'link rel="stylesheet" type="text/css" href="global.css" media="screen,projection,tv" /'

My JS files are added like:

'script src="jquery.mousewheel.js" type="text/javascript" charset="utf-8" /'
'script src="jScrollPane-1.2.3.min.js" type="text/javascript" charset="utf-8" /'
'script type="text/javascript" src="vars.js" charset="utf-8" /'
'script type="text/javascript" src="jquery.form.js" charset="utf-8" /'

I think somebody may be already using this library, can anybody provide me a good example to use the concatenation feature of this SmartOptimozer library or just guide me to concatenate my CSS and JS files using that library.

Thanks

1

1 Answers

1
votes

Unfortunately, concatenation feature don't work out of the box. To take advantage of this feature you need to modify your html code as follow (file names separated by comma (,)):

<script src="jquery.mousewheel.js,jScrollPane-1.2.3.min.js,vars.js,jquery.form.js" type="text/javascript" charset="utf-8" />

Note that only files placed in the same folder can be concatenated like that.

The same rule can be applied for CSS files with the same media type.