开发者

How to use the concatenation feature of SmartOptimizer PHP library?

开发者 https://www.devze.com 2023-01-05 16:43 出处:网络
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 ca

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开发者_如何学C" 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号