Magento, eBay owned platform is one of the top worldwide accepted framework where people choose to grow their ecommerce business. When it comes to site optimization and performance, Magento site needs high level of performace ability. Making sure that your ecommerce solution is running fast is one of the most important factor to your sales,SEO rankings and orverall user experience.
How important is a fast Magento store? Well consider the following:
Google considers site speed when ranking Web sites and determining how many pages to crawl
Forrester research has determined that 45% of consumers expect a Web site to render in 2 seconds and 52% said that site speed is important to their site loyalty
Gomez found that up to 40% of customers will abandon a shopping site if it takes more than 3 seconds to load and every second delay results in a 7% reduction in revenue
Here are some of the tips to speed up your magento store.
1. Latest Version
It is very important that your store is running the latest version of Magento. Your site also needs regular bug fixes, updates, patches installed and more importantly all your extension installed must be updated to latest version that prevents from bugs in future.
Image showing Security patch updates.
2. Content Delivery Network (CDN)
CDNs can give an equally fast web experience to your users across the globe.
across multiple, geographically dispersed servers will make your pages load faster from the user’s perspective. If your store is large that needs several server location, this can be useful.
3. Utilize caching
Magento comes with built-in caching feature. There are also 3rd party extensions for cache feature in magento.
To enable magento default cache from backend.
Navigate to “System” → “Cache Management.”
Select everything and then under the drop-down select “Enable” and click “Submit.”
Image showing cache enabled in default magento.
4. Page cache
When a user visiting a website page for the first time, Magento generate and deliver this page to the visitor and automatically save a copy of it to the cache (cache storage). Then all those pages just get stored in a cache. Each subsequent time when user request arrives, the system does not request Magento to generate a page, but returns the cache copy of the page from cache.
This greatly reduces database and server load. Once the server generate a page it does not need to generate it again and again, it simply returns only cached copies – immediately. An extension is significantly increase the load speed of Magento store.
Page caching is one of the most powerful ways to speed up Magento. Load is taken off from the webserver by serving pages already visited before from cache, which makes it a lot faster.
There are a few page caching extensions available for Magento, we recommend one of the following:
Full Page Cache
3. Gzip Compression
Gzip compresses web pages and stylesheets at the server level before sending them over to the browser.
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0 no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
4. Expire Headers
Expire headers tell the browser whether they should request a file from the server or grab it from the browser’s cache.
## Add default Expires header
ExpiresDefault “access plus 1 year”
5. Enable Flat Catalog
Magento uses the EAV model (entity attribute value) to store customer and product data. Enabling the flat catalog for categories and products merges product data into one table, thereby improving performance by responding to MySQL queries faster. If your eCommerce store has more than 1000 products, this can very beneficial.
Navigate to “System” → “Configuration” → “Catalog.”
Under “Frontend” change “Use Flat Catalog Category” and “Use Flat Catalog Product” to “Yes.”
Click on “Save Config.”
Clear the cache. The recommended way to do this is to delete everything from the /var/cache directory. You can also do it by navigating to “System” → “Cache Management” and clicking on “Flush Cache Storage” which is equivalent to deleting all the cache.
Catalog Flat data and category flat data needs to be reindexed so navigate to “System” -> “Index management” and click on reindex data after selecting all elements.
6. Image Optimization
The images you create in programs like Photoshop and Illustrator look amazing but often the file sizes are very large. This is because the images are made in a format which makes them easier to manipulate in different ways.
With file sizes upwards of a couple of megabytes per image, if you put these files on your website it would be very slow to load.
Optimizing your images for the web means saving or compiling your images in a web friendly format depending on what the image contains.
Optimizing your product images can dramatically increase the speed of your pages as this decreases their download times. You can download the optimized images from the report of gtmetrix or can use a number of extensions to auto-optimize images. The one i recommend is TinyPNG Extension.
Navigate to “System” → “Advanced” → “Developer.”
After combining these files, you will need to clear the cache. Follow the process we mentioned earlier.
8. Enable Magento Compilation
Magento has a compilation feature which has been reported to sometimes give up to a 50% performance boost. By default, Magento’s application files are searched in a certain order everytime the page loads, which results in a lot of filesystem reads. The Magento compiler reduces these reads by copying all of these files into a single include directory and also caches ones that are used more frequently.
Navigate to “System” → “Tools” → “Compilation.”
Click on “Run Compilation Process.”
Note: Before installing next extensions or upgrading Magento you have to disable this feature.
9. Clean Up Magento Database & Logs
By default, Magento keeps logs up to 180 days. This can result in your database growing quite large. You change it to something smaller like two weeks (14 days) to save space.
Navigate to “System” → “Configuration” → “Advanced”→ “System” → “Log.”
Under “Save Log, Days” change it to 14 days, or whatever you prefer.
Click on “Save Config.”
You can also manually clean up your database by emptying the log tables.
In phpMyAdmin select all of the log_% tables and select “Empty” from the drop-down box.
Click on “Yes” when it asks you if you really want to TRUNCATE the tables.
10. Fewer Extensions & Modules
You can also disable modules that you don’t use.
Navigate to “System” → “Configuration” → “Advanced”→ “Advanced” → “Log.”
On the modules you don’t need select “Disable” from the drop-down box and click on “Save Config.”
11. MySQL Configuration
MySQL has its own “query cache” that it uses in Magento to help generate dynamic pages and content while improving performance. These are some recommends settings for your my.cnffile.
query_cache_type = 1
query_cache_size = 32M
And also a recommended setting for php.ini.
php_value memory_limit 128M
12. Update Indexes
Magento updates indexes on every object store by default, but in some cases manual updates are required. Indexes are used to speed up MySQL queries.
Navigate to “System” → “Index Management.”
Select all of the indexes (or the ones you want to update), choose “Reindex Data” from the dropdown and click “Submit.”
13. PHP Accelerators
Using a PHP accelerator is another form of caching. They increase performance of PHP scripts by caching them in their compiled state. You can use a PHP accelerator like APC, ZendOptimizer+ or Xcache.
14. Choose Fast Web Hosting
And last but not least, choosing a reliable and fast web host can be one of the most important decisions you will make when trying to improve Magento performance. We recommend staying away from cheap shared hosting as they tend to overcrowd their servers and you will end up sharing resources between hundreds of people. We suggest going with a VPS like Digital Ocean, Linode, or Vultr. The reason is because you will be in complete control of your resources. And if you aren’t as tech savvy or don’t want to manage your servers via CLI, ServerPilot is a great control panel alternative which works with Magento and the VPS providers mentioned above.
As you can see there are many ways you can speed up your Magento eCommerce site. From implementing a CDN to caching, enabling flat catalog, image optimization, merging CSS and JS files, using the Magento Compiler, and cleaning up your database. Also having a good web host is equally important.
Do you have another way to speed up Magento that we missed? We would love to hear about it below in the comments.