Wednesday, December 25, 2013

Speeding up magento in 5 steps (very easy)

Out of the box Magento website can be very slow.The slowness of magento website can become a major obstacle to your web stores success. Lets find out Why Magento sites are slow ..

Reason Why Magento websites are slow :

Magento is a  highly customizable ecommorce solution.Developers of Magento have used a complex database design to make it customizable .This made the total system heavy and thus resulted slow website loading.

How to make Magento website fast :

1.Check the performence of your website from googles website insight . Here you will be able to view googles recommendations. List out what you need to do with your website. and finish one by one recommendations.

2. Magento developers noticed their system is very slow, so they came up with a clever technique. They started to use cache heavily. You will have to make sure you take full advantage of magentos cache management tool. go to admin>magento cache. here you will see a list of items. You need to ensure all of them are enabled.You also need to have your compilation proces run from admin>system>tool>compilation

3. If you look at the spped analyzer tools , you will see they provides amount of requests sent by your website to their test servers. Remember the more request your domain sents to the test server the slower it gets . So you need to find a way to minimize the amount of requests to speed up your magento website. In order to do so you can go to your .htaccess file and implement fiew modifications that I am giving bellow.

** you will find .htaccess file in your root folder of the magento installation. If you cant find it dont panic. Sometimes some hosting companies keep .htaccess files hidden . So when going through the root folder using file manager tick show hidden files option on the dialogue box.


Once you find your .htaccess file, open it up and look for following code.


############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# 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

# 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

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

# enable resulting html compression
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
# php_flag zlib.output_compression on 
 
 
 
 
Now remove comment from some of the codes that enables gzip compression. Shown bellow.
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# 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

# 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

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

# enable resulting html compression
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
php_flag zlib.output_compression on

What it does is, When host keeps the file compressed, and when the request is sent it decompress. It makes the site to load faster.


4. Go to admin panel and merge and minimize css/js . You can do this from system>configuration>developer> javascript settings and also css settings tab, just select yes from the select box that says if you want to merge your file or not.

5. Optimize image contents of your website. A website weight depends on its content. If you have heavy photos as your slideshow your website is bound to get slow. So always make sure your slideshow images are not heavier than 150kb. And also make sure you enabled category flattering technique. Which you can find from system>configuration>catalog>frontend tab> user flat category and product set to yes.




You can read more here .

If you follow this steps you will get about 60 percent better performence.

If you have any questions or want to share a better solution please comment bellow. After all we are here to learn and share.

Thanks

Saturday, December 21, 2013

First Post

The aim of this blog is to share my experience of working with different content management systems with the rest of the world. I have been working with CMS last 2 years. During this period I have learnt through many mistakes . I am hoping to share the solutions so other can find it easily.