My.tsoHostshopping_basket0 Item(s): £0.00

keyboard_backspaceBack to the Blog

Optimse Your Magento Site For the Christmas Rush

Posted 04th November, 2014 by Aliysa

Online shopping is changing: shoppers increasingly expect their experience to be smooth and enjoyable. Therefore, if you're using an ecommerce application like Magento, it's crucial to make sure that it's fully optimised, especially with the Christmas traffic rush just around the corner. Magento is famously very resource heavy, but with some simple checks and tweaks you can still transform your site into a fast and responsive store.

Before you Begin:

Before you get started, it's worth doing a quick speed test to gauge the current performance of your site. The best tool for this is the one from GTmetrix which provides an extensive report that accurately grades your site's performance.

Keep Up to Date:

Sounds obvious I know, but it's absolutely crucial that you're running the latest version of Magento. If you're not at least running version 1.9.0.1 then make the change, as updating will not only keep your site's security in tip-top shape, but you'll also benefit from new internal optimisation from the brand new features which have been rolled out.

w3c Compliant:

Untidy code can throw up unexpected and confusing errors, which is a surefire way of losing traffic. Use the free tools from w3c to test your site's markup and CSS; if the validation tool throws up any errors, consult your web developer who will be able to help iron out any issues.

Images:

Many Magento webmasters harbour concerns about scaling down their image size, feeling that it has a damaging effect on the image quality. Actually you can typically reduce the size of your image by up to 80% before you start to see any notable effect on quality and your loading times will be slashed as a result. There's lots of free tools which handle the compression process for you. If your site is hosted on our Cloud then you can also speed up images by serving static content to your site.

It's best to avoid embedding images from third party sites like Imgur and Instagram. You'll be at the mercy of the image host's server, as your users will need to connect to that server to load the images. If that server is slow or down, your website will load slowly (or look incomplete) and you'll suffer as a result, regardless of how brilliantly optimised your site is.

Parallel Transfers:

Many web browsers limit the number of files that can be downloaded from a server to 5, however with a few easy steps you could trick the browsers into thinking its downloading from two different servers, thus doubling the number of items loaded at once.

  1. Firstly add a ‘subdomain’ to your hosting that points to the same location as your main website (on Cloud add it as a ‘domain alias’ and on cPanel a ‘parked domain’).
  2. From your Magento Admin Page, visit the Magento Web section by going to System > Web
  3. Find the 'Secure & Unsecure' headers. Under here, set the Javascript, base skin URL and Media URL to the subdomain you just created.

Index Management:

To be sure that all of your site's indexes and caches are fully up to date, re-index the data by going to:

  • Magento Admin Page > System > Index Management

Unused Modules:

Disabling modules that your site doesn't use will notably improve the load time of the cart and admin site. You can disable any unused modules by visiting:

  • Magento Admin Page > System > Configuration > Advanced

Plugins:

Unused plugins are also one of the leading causes of site lag. To remove/disable them then you'll need to visit Magento Connect:

  • Magento Admin Page > System > Magento Connect

Note: always check your plugin's documentation before you disable any plugins, so you don't risk breaking your website.


.htaccess Changes:

Switch to Gzip

By adding the following snippet of code to your .htaccess file you'll direct Apache to use Gzip compression methods (mod_deflate). This means that your text, CSS and Javascript will be compressed before sending it to the browser.

` # Insert filter on all content SetOutputFilter DEFLATE # Insert filter on selected content types only AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Header append Vary User-Agent env=!dont-vary `
Add ‘Expires Headers':

Web browsers use Expires Headers to determine how long a page component can be cached for. Static components of a web page, like images, should ideally have far-future expires headers, but we recommend that all page components have Expires Headers. Add this snippet of code to the top of your .htaccess file:

` Header append Vary User-Agent env=!dont-vary ## Add default Expires header ExpiresActive On ExpiresDefault "access plus 1 year" `
Disable ETags:

ETags are a way for browsers to validate cached components across subsequent visits. Add this snippet of code to the top of your .htaccess file:

` # Disable Etags FileETag none `

Make the Most of Built in Features:

Minify Javascript and CSS:

Magento has an inbuilt tool to reduce the amount of file requests being made. To take advantage of this readily available feature follow these simple steps:

  • Magento Admin page > System Configuration > Developer > Under “Javascript Settings”, change “Merge Javascript Files” to YES.
  • Magento Admin page > System Configuration > Developer > Under “CSS Settings”, change “Merge CSS Files” to YES
Enable Caches:

Caching is temporarily storing page data, which speeds up loading time when you go to open it again. There's a whole dedicated page for customising and managing your caching settings in Magento, which you can find at:

  • Magento Admin Page >System Configuration > Cache Management

Note: When you make changes you will need to refresh the cache for changes to take effect.


Enable the Magento Compiler:

When a browser requests a URL from Magento, then the store will look for it in these four directories, in the following order:

` app/code/local app/code/community app/code/core lib/ `

This gives you the ability to extend Magento functionality. For example if you want to change or modify a class, you place it in app/code/local and Magento will find it first and run it instead of the core definition in app/code/core. However, this means a lot more disk space is used for every request.

Luckily Magento Compiler is here to help: in effect it copies all of the class definitions and code found under app/code into a single directory: includes/src/. It then gets rid of all other include paths and replaces them with the new one. This way, Magento only needs to search one directory instead of four for each request, dramatically cutting your slash time.

Note: Magento Compiler can often conflict with plugins, which end up breaking your site. Only try this tip if you've got a full understanding of what you're doing.

To run this rather useful tool follow:

  • Magento Admin Page > System > Tools > Compilation

    • *

Databases:

Disable internal logging and using external logging

Magento tracks a phenomenal amount of data, which is great but can occasionally lead to websites grinding to a halt when performing simple queries to a table. log_visitor, log_visitor_info, log_url_info and log_url tables often fill up quickly, so keep a close eye on the amount of data stored by visiting phpMyAdmin. If they're very large (i.e. 100MB) or more our team can truncate the data for you if you're happy to lose it, or you can do it yourself using a plugin like Yireo.

Flat Catalog

Magento makes heavy use of the EAV model for storing customer, product, and category data in its database. The main benefit of the EAV model is that it allows for completely extensible attributes for those objects. The main drawback of this is that those attributes are stored in multiple tables rather than one very large table. This means that SQL queries need to be longer and more complex. Using the Flat Catalog feature creates new tables where each row contains all of the necessary data about a product or category, making the SQL queries much more efficient.

Whilst all Magento sites should use the Flat Catalog for Categories, the Flat Catalog for products only starts to become useful once you've reached 1000 SKU. You can enable both of these from the back end:

  • Magento Admin Page > System > Index Management and make sure “Product Flat Data” and “Category Flat Data” are built and ready.
  • Magento Admin Page > System > Configuration > Catalog > FrontEnd and select “Yes” for Use Flat Catalog Category and (if desired) Use Flat Catalog Product.

    • *

There's lots of tips and suggestions here, and some are more effective than others. If you feel that we've missed anything out then we'd love to hear from you in the comments section below.

Categories: eCommerce, Tips

You may also like:

Reasons we love WordPress
Three types of web hosting that are ideal for small businesses
5 signs you’re going to need a higher-tier hosting plan
Top hacks for saving money when you launch a business online
What sort of hosting do you need [Quick Quiz]
The most popular tsoHost blogs of 2021 and what they tell us about the year gone by