Is there a service out there that provides public API for compressing CSS or Javascript?
(Like imgur let's you upload images trough PHP and get the image URL)
-
Why would you want this?thirtydot– thirtydot2011年08月19日 09:56:51 +00:00Commented Aug 19, 2011 at 9:56
-
because the generated css / js is dynamic, and I was thinking I could use a service like this to generate a minifed cache of the css/jsAlex– Alex2011年08月19日 09:58:13 +00:00Commented Aug 19, 2011 at 9:58
-
SO is actually about coding help and support, not about searching for services, there are plenty of sites that can help you with that.Madara's Ghost– Madara's Ghost2011年08月19日 09:58:35 +00:00Commented Aug 19, 2011 at 9:58
-
How often does it change? Every page load? When you upload changed files?thirtydot– thirtydot2011年08月19日 10:07:08 +00:00Commented Aug 19, 2011 at 10:07
-
when the site administrator changes the site configuration (like changing color scheme, adding new content blocks etc)Alex– Alex2011年08月19日 10:12:20 +00:00Commented Aug 19, 2011 at 10:12
9 Answers 9
Google Closure Compiler let's you send JavaScript code with POST request and returns optimalized code.
Comments
The Closure Compiler can be used for JavaScript. It has an API (link on the top right hand corner). It does a decent job on compiling JavaScript.
Comments
The YUI compressor by Yahoo is your best bet. You can download it (http://developer.yahoo.com/yui/compressor/), or use an online solution: http://www.refresh-sf.com/yui/
It does CSS and JavaScript.
Comments
Pretty Diff can minify CSS, JavaScript, and HTML.
Comments
Free developer tools can minify and beautify CSS and JavaScript.
Comments
I prefer using the tool on www.blimptontech.com for minifying my Javascript files. They also have a feature to combine your files into one and minify at the same time. I like it because it uses UglifyJS to get the dirty work done.
Comments
Another online tool you can use to minify/compressing your js is http://samqode.com/minifyjs . very soon There will be a public API available for on the fly (via url request) minification so its a good one to watch out for.
1 Comment
You can use jsCompressor and CSSCompressor for minifing your javascript and css code.
Comments
I am using .Maui and it is awesome! You can minify and combine CSS and JS using the web tool or the free API. For JS it even optimize the code and is ES5 and ES6 compatible! There are other useful tools like Sitemap Generator, HTML Minify, Image Resizer and Free CDN for the minified files.
Before i tried Google Closure Compiler, cssminifier.com and javascript-minifier.com, but they have restrict limits of POST size and number of requests per second.
Comments
Explore related questions
See similar questions with these tags.