Speeding Up Magento – Merging Asset Files
by: Andrew Clark
Recently here at Oozle Media we moved one of our Magento websites to its own server. We took the opportunity to do some optimizations that would increase the performance and scalability of the website. While Magento is a great platform, it is not known for its speed. There are, however, many things you can do to speed it up without throwing more hardware at the problem. While I won’t go into great depth here about what we did, I thought I would highlight one small tweak that can greatly increase the speed of your website without having to modify the configuration of your web server.
- Login to the admin
- Go to System -> Configuration -> Developer
- Under each of these sections, you’ll see the option to merge these files by changing No to Yes
- Click Save Config at the top right
One strange side effect of this change is that some of your background images may now be requested by Magento with https rather than http. When https is used, the server and the visitor’s browser will spend additional time on encryption. As it turns out, this only happens to background images that are listed in your CSS files with a relative path. Relative paths are those that look something like this:
This odd effect will only happen if you have an https URL specified as your Secure Base URL in Magento’s configuration and if you have the "Use Secure URLs in Frontend" setting turned on. In order to prevent Magento from converting these URLs into https versions, replace them with absolute paths like so:
Magento will then generate the correct version of the URL for the http or https environment that the visitor is currently in.