Minify HTML CSS JS

Minify HTML CSS JS
M1

TOTAL:
$0.00
Compatible With: Community 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7, 1.8, 1.8.1, 1.9, 1.9.1, 1.9.2

Tech Specifications

Seller:
Current Version:
1.5.1
Type:
Stable Build
Updated:
04 July, 2017
Categories:
Extensions, Site Optimization, Performance
License Type:
Open Software License 3.0 (OSL-3.0)
Policy:

Overview

Minify HTML CSS JS including inline CSS/JS and speed up your site. Works with default Magento CSS/JS merger.

Other Extensions by Apptrian

Overview

Back to top

Apptrian Minify HTML CSS JS is a very small and efficient extension. It will minify HTML including inline CSS and JS code. Minification of CSS and JS files is compatible with default Magento CSS and JS file merger. There are no complex setups nor query strings on minified CSS and JS files. Extension is very easy to install and use. Compatible with FPC and Varnish cache extensions. If there is a serious error in some page code that page will not be minified. Extension will log the error and url of the page where this error occurs so developers can track it down and fix the code.

Minification is the process of removing all unnecessary characters from source code without changing its functionality - e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on. After minification code is smaller in size that means less bytes will be transmitted from your server to your customer's web browsers which makes your site pages load faster. Beside small speed increase search engines (especially Google) will give you a plus in the SEO department (Search Engine Optimization). So you should definitely Minify your code.

Features

- Easy way to enable or disable HTML Minification.
- Option to set Maximum HTML Minification.
- Cache Compatibility Mode option for HTML minification.
- Option to remove important comments or not.
- Easy way to Minify CSS and JavaScript files with a button click.

Pre Installation Instructions

Do the following Before you install Minify HTML CSS JS extenison!

- If you are using "Expires Header" turn it off temporarily.
- If you are using CDN turn it off temporarily.
- Go to your Magento Admin and enable:
System > Configuration > Developer > CSS Settings > Merge CSS Files
System > Configuration > Developer > JavaScript Settings > Merge JavaScript Files
Flush and Refresh Magento cache (System > Cache Management)
- Visit home page, one CMS page, one category page, one product page, cart page, and checkout page and wait for all of them to fully load (do not interrupt). This is done so Magento default merger can merge CSS and JS files, and some extensions add CSS and/or JS files only on specific pages not globally.
- Use HTML, CSS, and JS validators to check your website. Warnings can be ignored but errors must be fixed. (Some errors can be ignored like the ones regarding HTML attributes.)
- After you fixed everything only then install and use our extension.

Installation Instructions

- Log in to Magento Admin
- (Optional) Disable Magento Compiler if you are using it (System > Tools > Compilation)
- Go to (System > Magento Connect > Magento Connect Manager) and install extension
- Go back to Magento Admin
- Flush Magento Cache (System > Cache Management), then log out from Magento Admin and log back in
- (Optional) Enable Magento Compiler by clicking "Run Compilation Process" button (System > Tools > Compilation)
- Enable (System > Configuration > Developer > CSS Settings > Merge CSS Files)
- Enable (System > Configuration > Developer > JavaScript Settings > Merge JavaScript Files)
- Flush and Refresh Magento cache (System > Cache Management)
- Visit several pages of your site on the frontend and wait for them to fully load. (Visit home page, one CMS page, one category page, one product page, cart page, and checkout page. This is done so Magento default merger can merge CSS and JS files, and some extensions add CSS and/or JS files only on specific pages not globally.)
- Click Minify button and wait for CSS/JS files to be minified.
- (Optional) If you are using Expires header for CSS and JS files remember to empty your web browser's cache.
- (Optional) If you are using CDN make sure you flush/empty CDN cache.

If you do not know how to install extension or you wish a professional to do it for you, we offer additional Installation service for a small fee.

This extension is FREE however support is NOT

Please understand that we get more than a few emails almost every day asking for support. In most cases problems are lack of basic Magento knowledge and not reading Installation Instructions. Due to our other projects we do not have time to answer all of them. Because of this we cannot provide free support for our free extensions. However we offer very affordable support options for this extension on our site.

FAQ

Q: Why after clicking "Minify" button and success message, when I look at the files from my browser they are not minified?
A: You are probably using Expire Headers on CSS and JS files (Leverage browser caching). Your browser is showing you cached (old) version of the files. To quickly check if your files are minified use Google Page Insights or similar testing utility.

Q: Why after enabling minification my pages are all mangled up / have missing parts?
A: You probably have errors in your HTML/CSS/JS code. One stray tag is enough to cause this behavior. Before you enable minification you must have error free code. Turn minification off, use W3C validator to find errors and fix them.

Q: Why are not all CSS/JS files merged and minified?
A: First of all external(off site) CSS/JS files will not be merged and minified. For example:
Minifying https://platform.linkedin.com/…ork?v=0.0.2000-RC8.41700-1420&lang=en_US could save 2KiB (5% reduction) after compression.
This happens if you use Linkedin button, this file is on Linkedin server not on your server it is their responsibility to minify it, not yours, your Magento installation nor our Minify extension.
Second, all CSS/JS must be properly included in Magento via .xml file (for example page.xml of your theme). Some extensions might hardcode link and script tags into .phtml templates, these files will not be merged by Magento default file merger (Magento does not know about them because they are not properly included) and subsequently our Minify extension will not minify them.

Q: Why Google PageSpeed Insights reports that CSS/JS files are not fully minified? (1)
A: Sometimes it is because gzip compression is turned off on your server. Use your .htaccess file to enable it.

[IfModule mod_deflate.c]
# Compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
[/IfModule]
(* Because of html filtering we cannot write exact code here. Instead of [ and ] less than and greater than should be used. Visit our site to see it better.)

Q: Why Google PageSpeed Insights reports that CSS/JS files are not fully minified? (2)
A: Sometimes Google PageSpeed Insights will report that CSS/JS files are not fully minified. For example:
Minifying https://www.apptrian.com/…a/js/6a3cfa142fd20a7dc62423f1c15e4ad9.js could save 648B (1% reduction) after compression.
This is normal. Some of the CSS/JS files/libraries published by Google also have this or similar complaints from Google PageSpeed Insights.
Minifying https://apis.google.com/…/cb=gapi.loaded_0 could save 684B (2% reduction) after compression.
If Google itself cannot satisfy its own Google PageSpeed Insights testing tool, then what chance anyone else has. :-D
Rest assured your files are properly minified, by the tools recommended by Google, so just ignore these types of complaints from Google PageSpeed Insights.

Q: When I click "Minify" button in extension configuration I get "Connection reset" error?
A: If you are on Windows you must set your Apache properly. (It is a common problem when working with long regular expressions in PHP). You need to increase the Apache's stack size. The best way to alter the Apache's stack size is using the ThreadStackSize directive in the Apache's configuration file. Here is how to do it.In your Apache httpd.conf file uncomment #Include conf/extra/httpd-mpm.conf like this.

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

Then in conf/extra/httpd-mpm.conf file set ThreadStackSize to 8388608. Something like this:

[IfModule mpm_winnt_module]
ThreadStackSize 8388608
[/IfModule]
(* Because of html filtering we cannot write exact code here. Instead of [ and ] less than and greater than should be used. Visit our site to see it better.)

Q: After clicking "Minify" button I get white screen in the web browser?
A: Delete all files in following directories: media/css, media/css_secure, and media/js then visit several pages of your site on the frontend and wait for them to fully load. (Visit home page, one CMS page, one category page, one product page, cart page, and checkout page. This is done so Magento default merger can merge CSS and JS files, and some extensions add CSS and/or JS files only on specific pages not globally.) After you done this click "Minify" button again and wait for it to finish.

Q: After clicking "Minify" button my site is all mangled up or not working?
A: You probably have errors in your CSS and/or JS files. Delete all files in following directories: media/css, media/css_secure, and media/js then use CSS and JS validators (CSS Lint and JS Lint) to check your code and fix errors before you try to minify again. Just before you want to try minification again repeat the process of deleting files in media/css, media/css_secure, and media/js directories and visiting several pages on your frontend.

A Word From the Author

Thank you very much for your interest in Minify HTML CSS JS extension. You can rest assured that by choosing this extension you are getting high quality product despite the fact it is free. Same professional approach, dedication and care are invested in this product as if it is paid one. If you find this product useful and want to say "thanks" you can do that by rating it and writing short review about it on Magento Connect. Also you can like, share and follow us on Facebook, Google+, Pinterest, and Twitter.

If you have any questions about extension or Magento in general feel free to contact us.

Release Notes

Back to top

1.5.1:

  • Compatible with CE: 1.5 1.6 1.6.1 1.6.2.0 1.7 1.8 1.8.1 1.9 1.9.1 1.9.2
  • Stability: Stable Build
  • Description:

    * Fixed few small issues with admin blocks
    * Code standards improvements

Support

Back to top
The best place to start if you need help with a specific extension is to contact the developer. All Magento developers have both a contact email and a support email listed.

Q & A

Back to top

Reviews

Back to top