Mobile app version of vmapp.org
Login or Join
Phylliss660

: Is there a Magento extension for combining/compressing javascript and css? I thought Magento came with this feature out of the box but it doesn't appear to be working at all. I'm not sure if

@Phylliss660

Posted in: #Compression #Css #Javascript #Magento

I thought Magento came with this feature out of the box but it doesn't appear to be working at all. I'm not sure if I haven't set it up properly, but right now I'm resorting to using cat and altering the page.xml layout file to use the combined javascript and css files.

Can I make Magento do this instead or is there an extension that adds this feature?

(duplicate of stackoverflow.com/questions/4236381/is-there-a-magento-extension-for-combining-compressing-javascript-and-css)

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

3 Comments

Sorted by latest first Latest Oldest Best

 

@Berumen354

So far the Magento module method of doing this is using Fooman Speedster. It merges and minifies your Javascript and CSS fils, typically merging everything into two JS files and two CSS files. I've had issues using Magento's built-in JS/CSS merge so I abandoned it for the module. The developer keeps it up to date and it works with versions 1.2 though 1.6. Free.
www.magentocommerce.com/magento-connect/fooman-speedster.html
It requires mod_rewrite to be enabled and .htaccess support. Installation of Yoast's Canonical Urls extension or the Mxperts jQuery Base extension will break the extension.

10% popularity Vote Up Vote Down


 

@Steve110

The quickest thing I can think of is Google's mod_pagespeed for Apache. I've used it on my Magento store and didn't have any issues with the combination of the JS and CSS, though did run into some issues with the caching and what have you, but you can turn those off pretty easily.

With mod_pagespeed, you want to use these filters in you pagespeed.conf:

# Combine CSS
ModPagespeedEnableFilters combine_css
# Minify Javascript
ModPagespeedEnableFilters rewrite_javascript


Also, check out the .htaccess file in Paul Irish's HTML5 Boilerplate. He outlines how to combine certain JS files. You don't want to combine all Javascript into one file, becaue there might be times when you want JS to run in a certain order.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme