4

I am working on project which is having more than 10 CSS + JS files.

I want to minify/compress/obfuscate CSS and JS.

One approach is I can do this manually.

But apart from manual effort is there any function/method available in Zend Framework to achieve this goal?

Thanks in advance!

5 Answers 5

4

Try Minify I have used it in several ZF projects. Just install it in /public_html/min it will then minify and compress css and javascript on the fly and has a cache feature. On the whole the peformance is very good and the script has a small footprint.

Sign up to request clarification or add additional context in comments.

1 Comment

We're using this too (it comes with ZF helpers) and it is working great.
2

We wrote a shell script that runs all the files through YUI compressor and then bundle them all together. It may look complex initially but it's not. This script ended up being our one-command-deployment for our app.

This shell does plenty of other thing specific to our backend architecture(git, Erlang,...) so I can't extract this specific part easily. But Yahoo's doc is well done.

1 Comment

I will consider your solution and will let you know how feasible it was in my case. Thx for your answer.
0

As Mic suggest ,its very good to YUI + Shell command and i can add another suggestion outside of ZF field google pagespeed mod has many filter than can achieve your goals easily

http://code.google.com/speed/page-speed/docs/filter-js-minify.html

http://code.google.com/speed/page-speed/docs/filter-css-rewrite.html

1 Comment

Thx for your answer. Will let you know whether it worked for me or not after a test.
0

Haven't tried it yet, but bundle-phu is probably what you are looking for.

Comments

0

Mic suggestion is nice, but for me it is much easier to use management/build tool like maven.apache.org (for php) to do this stuff and a much more required automation (for instance testing). And I'm using self written tool for js obfuscation cactus, which can be used as separate console tool as well as maven plugin.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.