I’m confused between the two. Which is better, especially for jQuery and JS? Also, which do you think is more SEO-friendly? Note: I’m a noob.

migrated from stackoverflow.com Dec 16 '11 at 8:36

This question came from our site for professional and enthusiast programmers.

  • I don't think that it matters. – ckruse Dec 16 '11 at 8:26
  • minified code because obfuscated code is smaller but you should do more operations every time and the code will be cached when it is loaded the first time so the first loading time is not so important – micha Dec 16 '11 at 8:28
  • +1 for confessing that you are noob. Me too but I never admited it but I'll do now :D – Sean87 Dec 16 '11 at 8:28
  • @chown Just edited the title. I'm really asking for opinions about using "minified" or "obfuscated" code. :) – jazzQuery Dec 16 '11 at 8:33

None of them. It will not be indexed (only in obscure odd cases).

Minifying JS is about loading speed and obfuscating JS is for making it harder for other developers to read your code.

Google does however rank your website based on load speed, and if you are including 15 JavaScript files and 20 stylesheets, your site gets slow and therefore loses rank. Therefore it's a great idea to combine these 15 JavaScript files into one and minify it, to minimize the loading speed.

This is because most user-agents (e.g. browsers) can only make 2 simultaneous requests on the same domain.

  • Hey Jan, thanks for explaining it in layman's terms! – vurquee Dec 16 '11 at 8:39
  • Minify = pull out all the spaces and carriage returns so it loads fast, Obfusticate = muck it up to hide crappy code. Obfustication is easily overcome, what I've noticed is that it's a good indicator that you don't really want to copy the hack jobs it contains anyway. Find the effect in the obfustication, educate yourself on how it's really supposed to work and write it to proper W3C standards and you'll have better results. – Fiasco Labs Nov 17 '13 at 21:24
  • Fiasco Labs, some times yes, but you missed the main point of the answer. My main point was actually about reducing http requests (which increases overall page speed) - and one great way to do this is combining/minifying css/js. – Jan Dragsbaek Nov 18 '13 at 22:37

If you minify your JavaScript, your page loads faster and that matters for SEO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.