5

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)

6
  • Why would you want this? Commented 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/js Commented 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. Commented Aug 19, 2011 at 9:58
  • How often does it change? Every page load? When you upload changed files? Commented Aug 19, 2011 at 10:07
  • when the site administrator changes the site configuration (like changing color scheme, adding new content blocks etc) Commented Aug 19, 2011 at 10:12

9 Answers 9

4

Google Closure Compiler let's you send JavaScript code with POST request and returns optimalized code.

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

Comments

2

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

1

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

1

Pretty Diff can minify CSS, JavaScript, and HTML.

http://prettydiff.com/?m=minify&html

Comments

1

Free developer tools can minify and beautify CSS and JavaScript.

http://freedevelopertools.com

Comments

1

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

1

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

this one is based on Google Closure Compiler as well
0

You can use jsCompressor and CSSCompressor for minifing your javascript and css code.

Comments

0

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

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.