minScript is a Yii Framework extension which extends clientScript to automatically combine, minify and compress files. The files are served with optimal client cache headers which dramatically improves the web application performance and eases the load on web servers.
Please visit the extension's wiki page for a full documentation on minScript.
You may find more help and information in the minScript forum topic.
To report a problem or see open issues visit the extension's issues page.
Total 20 comments
Hey notsoluckycharm
if i understand you correctly you are suggesting that minScript should create the combined, minified and compressed files instead of serving the content out directly. The content is served directly for some good reasons, one of them being that this allows to send specific headers directly without having to change the web server configuration.
I'm sorry to hear that it breaks your scripts. Most of the time this is a problem of how the scripts react to being minified and combined and not all scripts play well with that. In minScript version 2.2 you can exclude certain files from being processed, this might help.
Hey karmraj
The slowdowns you are reporting are most likely caused by another extension which constantly publishes files and therefore forces minScript to update itself all the time. Unfortunately there is not more information but try looking in that direction.
Also, "optionname" and "optionvalue" are placeholders which can be replaced by properties as described here.
Hey olemara
First of all, thank you for the praise.
This looks like a problem with your "CUrlManager" configuration. Is the property "urlFormat" set to "get" or to "path"? Try setting it to "get".
Also i think some information got stripped out of your comment (URL) which makes it a bit harder to debug this.
Hey atrandafir
Since version 2.2 you can exclude certain files from being processed. Have a look at the property ExtMinScript::$minScriptUrlMap
Hey jiaming
I tried the configuration you provided and it works flawlessly for me. Are you using the latest version of minScript (2.2)?
Wish it would integrate and publish assets passed to it using absolute urls instead of making itself as an endpoint.
It also breaks half my scripts ( require.js ) ... moving on to the next extensions.
My Application is under development. I have read about this extension from community. Today i have configure this extension. It's working perfectly but it takes more time then before it takes to load a page.
I have make following change in configuration file. And one more problem is that, whatever steps i have follow to configure this extension from this link : bitbucket.org/TeamTPG/minscript. i got an error as "Extoptionvalue" is not define so when i had commented follwing optionname line its working.
'controllerMap'=>array( 'min'=>array( 'class'=>'ext.minScript.controllers.ExtMinScriptController', //'optionName'=>'optionValue', ), ), 'components'=>array( 'clientScript'=>array( 'class'=>'ext.minScript.components.ExtMinScript', //'optionName'=>'optionValue', ),so let me know, is there any problem in my configuration or i had made any mistakes.
Thanks, Karmraj Zala
Hi there,
and thank you for what seems to be a great extension. I am new to the minifying process so there may be holes in my knowledge here. I have the newest Yii version, minify 2.1 installed, and the latest version from your homepage. The folders are created in the runtime directory, but I get this message in the php log file:
[Fri Mar 01 10:00:44 2013] [error] [client 127.0.0.1] File does not exist: /var/www/min/serve, referer: http://localhost:5555/
So I can not serve the file. Using the URL builder i get URL's like this:
which works. How can I buypass this problem?
Cheers!
Hello,
I am using yii-debug-toolbar on my development machine and minScript does process also the javascript/css coming from yii-debug-toolbar, and that makes the page a little bit slower.
Is there any way I can tell minScript to exclude it?
Thanks.
minscript works fine for me, so, thx!
I've even got a fork up at https://bitbucket.org/andyhot/minscript that adds support for coffeescript, sass, less (basically by augmenting ExtMinScriptSource)
Keeps telling me there are unexpected token ! and some functions are not defined....
Looks like the javascript integration isn't going well...
Here is my setup, any problems?
THank you!
Hey Revelis Luc Bonnin
I tried to reproduce this with RedactorJS but it worked flawlessly in my setup.
If there's still a problem please report an issue here with more details of your setup: https://bitbucket.org/TeamTPG/minscript/issues?status=new&status=open
Hi, This extension works really great except for my pages where i have a wysiwig load.
If js are minified using minscript, the wysiwig doesn't load and i got my poor default textarea :( Any idea ? (no js error, wysiwg simply doesn't load).
I'm using redactorjs wysiwig.
I had something similar but i found other extensions to be responsible for that kind of action. For example bootstrap extension was regenerating some files and it didn't allow for minscript to read from cache.
Hey twb
A full documentation with all the properties can be found here: https://bitbucket.org/TeamTPG/minscript
what is ExtMinScript::$minScriptLmCache when should we consider using it?
Hey ThePaulius
Thank you for the feedback.
Following things could be happening although it is hard to debug without more information from your side: 1. Something in your application changes a CSS or JavaScript file on every request which makes minScript reprocess the files instead of serving them from the cache. This leads to a big slowdown. Try to figure out if anything is recreating or modifying files on each pageload. 2. You have tons of files and the filemtime checks are slowing down your application. If this is the case, try looking into following property: ExtMinScript::$minScriptLmCache.
In case you need more help or there are still issues, please open a ticket here: https://bitbucket.org/TeamTPG/minscript/issues/new
Installing as is out of the box, it does what it says on the tin, however, I've found that the load placed on the server actually slows down the site more than if all the files were not Minified..
:o(
I've had to disable it.
I manage to do everything like you said :) thanks! rule i used:
Hey briiC.lv
minScript already uses urlManager to create URLs. In your case, urlManager needs to be configured to create minScript URLs with parameters in path style. I don't know exactly what your urlManager rules look like, so I can't give you a specific rule, but it can all be solved by configuring urlManager and the URL rules.
where the scripts are registered isn't controlled by minScript but by CClientScript::$defaultScriptFilePosition and CClientScript::registerScriptFile().
Leave a comment
Please login to leave your comment.