Friday 22 May 2015

How You Can Improve Page Speed in Magento 2

All of us are aware that Magento 2 is replete with lots of improvements in terms of features and interactivity apart from security updates as well. But questions on how its page speed can be improved have always remained. Now does speed automatically mean better performance? This leads us to a larger debate on performance and scalability, which are both related but different.

Performance and Scalability

Now, say you want to improve your server performance enabling it to handle some more load. But you may also choose to change the architecture in such as way that your performance is reduced but scalability increased. For instance, a shared or distributed redis cache could be less efficient when compared to running on a single server. But a shared server architecture improves your scalability though it cuts down on  performance. 
 
When it comes to ecommerce, people want sites to be speedy and responsive and so, what often matters the most is the speed at which the page is being rendered in the web browser. As far as Magento 2 is concerned, the Magento PHP server code takes up a third of the time and the remaining time is taken up for the Javascript, CSS files and all other web page components to download. Improving speed, therefore, involves not one but many factors.

Javascript Bundling

To manage Javascript file downloads, Magento uses RequireJS which results in an increased number of download requests. This in turn affects page performance.

The idea here is to bundle the JS files so that we have one request in place of ten. This also includes reducing/compressing the files by removing comments etc. Here you use the modularity features of RequireJS so as to reduce the effort.

This, you would find greatly reduces the page load time without you having to use the original raw files or reworking your code.

Inline Javascript 
 
Removing Inline Javascript can also greatly reduce the load time for the user, making the page appear before the user faster due to the DomContentLoaded event loading two times quicker. The downside though, is that you will need Javascript to fully render a page.

HTTP2 Protocol

This has many features like improved downloading of page assets and allowing the server to transfer files the browser needs before the browser asks for it. In fact, some developers opine that the improvements in HTTP2 will make the use of RequireJS redundant.

So, a combination of the above improvements will no doubt take your page loading speeds higher!

Wednesday 20 May 2015

How You Can Avoid Hosting Errors in Ecommerce

Web hosting is a subject that generates so much buzz in the media but yet there is so little clarity about what it really is. The result: people get stuck with bad sites that eventually don't go live. This article looks to make a few terms clear for you enabling you to avoid errors while you host.

Storage Space

This is the amount of space you lease on the host’s server, and it is measured in megabytes. How much do you need for your site? Well, on most Websites, one page with limited graphics and some text would on average, take 5 kilobytes. If you have heavy graphics, photos, etc. your pages might require up to 30 Kb. 
 
Multiply the number of pages by the number of kilobytes to calculate a rough estimate of how much space your site currently needs. Also, don’t forget to account for space that will be used by other things you’ll store on the server. ebooks take up an enormous amount of space, as do Flash movies. They’ll also be stored on the host’s server, and need to be included in your estimate. Try to predict what you’re likely to add to the site in the future, and include that in your total — you’ll want to allow some room for growth.

Bandwidth 
 
When files are transferred from the host’s server to the site visitor, they use up bandwidth. When pages are clicked and displayed on the screen, when ebooks are downloaded, when shopping carts are put to use, bandwidth comes into play. The more "active" your site is — the more there is for the site visitor to do — the more bandwidth you’ll need.

Email Accounts 
 
There are two primary types of email that Web hosts offer. Web mail is email that can be accessed online using your browser. You pull it up and view it just as you would any other Website. POP3 email is that which can be used with email software (called an email client) such as Outlook Express, Outlook, Eudora or Pegasus. 
 
Where you need to be careful is in determining how you’ll manage your email accounts, and what charges are involved with each alternative. Some hosts offer a limited number of POP3 addresses and then charge you for additional ones. Others may not offer a "control panel" for the maintenance of your email addresses, and might charge you to process any changes you need to make.