So far in this series, we have made most of the required steps for on-site optimization. Now, in the third part of this series, you'll learn how to optimize your Magento installation to reduce page load time, and how to integrate rich snippets to make your search results look more professional.
Increasing Speed
Reducing page load time is a concern for all web developers. Magento, being a giant of a CMS, is not very fast, but making some small modifications can increase its performance. Reducing page load time is necessary not only to improve user experience and reduce bounce rate, but also to help you rank well in search engines. Since 2010, Google gives special importance to a website's page load time in determining its page ranking. Here we’ll briefly discuss some quick and feasible ways to reduce the page load time of your Magento store. The fastest and easiest way to make your Magento site fast is by making some small changes in the Magento admin panel. First of all, we’ll enable the Magento cache. This small step alone will reduce page load time by 30% to 40%. When the Magento cache is enabled, Magento does not have to load all of the page resources from the servers at each page request. To enable Magento cache, go to System > Cache Management. Select all cache types and from the top-right corner drop down select Enable and submit. Secondly, we need to merge our CSS and JS files prior to page rendering. We’ll go to System > Configuration > Developer. Here you’ll see Merge JavaScript Files and Merge CSS Files. Set both these fields to Yes, and hit Save. This merging of CSS and JS files will reduce the number of requests to the server while the page is loading. This will again substantially reduce page load time. Next, we’ll run the Magento compilation process. The compilation feature of Magento will compile all Magento files to create a single include path for increased performance. This reduces page load time by 25% to 50%. In order to use this tool, the directory includes and the file includes/config.php must both be writable. To initiate the compilation process, go to System > Tools > Compilation. In the top-right corner, you’ll see the Run Compilation Process button. Click on it, and you’ll be done. Next, we have a few advanced steps for reducing page load time that require changing content in the .htaccess file. There could be many .htaccess files in a Magento directory, but here we’ll edit the one located in the root directory. Through the .htaccess file, we’ll first do the content encoding, which will compress the file before sending it to the requesting agent. This will reduce file download time. Secondly, we’ll add expiration duration to headers. This means that while downloading resources, the browser will check whether the headers have expired. If they have not, then the cached versions will be used. To enable compression, uncomment this line of code in your default .htaccess file, i.e. remove the # before php_flag zlib.output_compression on:
1
2
3
4
5
6
############################################
# enable resulting html compression
php_flag zlib.output_compression on
############################################
Next, to set gzip compression into action, we’ll add these lines into the .htaccess file:
Lastly, let us place an expiration limit on the headers, by adding this code into the .htaccess file:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
############################################
<IfModule mod_expires.c>
# First of all enable expirations
ExpiresActive On
# Default expiration
ExpiresDefault "access plus 1 month"
# For favicon
ExpiresByType image/x-icon "access plus 1 year”
# Set Images Expiry
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# Set CSS Expiry
ExpiresByType text/css "access 1 month”
# For Javascript Expiry
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
############################################
One very important thing to consider for improving the speed of your Magento store is the choice of server. This Tuts+ article does a great job of explaining the factors you should consider to ensure your server choice is a good fit for Magento.
Implementing Rich Snippets
Now it's time to devise a way to implement schemas—or rich snippets—into our Magento store. They will not only make your search results look more professional and help them stand out, but they're also likely to increase the click-through rate on search pages. The rich snippets we’ll integrate in this tutorial are product, offer, and aggregate rating, and in the end I'll give you some resources on implementing breadcrumbs and organization schemas. By default, the results in search engine result pages look like this: Through implementation of rich snippets, they can stand out and look like this: Please be aware that implementing these snippets will require editing template files. You will need to have some basic understanding of HTML and PHP to implement them. Also, do make sure that you keep a backup of each file before editing it. We’ll start by implementing the product scheme. Open up this file in your editor: app/design/frontend/[package]/[theme]/template/catalog/product/view.phtmland add the highlighted code into the product-view class.
Now let’s tag the product name, description, and image. To tag a product name, find the h1 tag containing the product name, and add the following code in it:
Next, in app/design/frontend/[package]/[theme]/template/catalog/product/view/media.phtml, find the image tags (you’ll find two instances of them on lines 40 and 62 if you are using the default theme), and make sure that they include the following:
Now, we’ll add product aggregate rating information. For that, open up this file: app/design/frontend/[package]/[theme]/template/review/helper/summary.phtml Replace the complete code of this file with the code given below:
<?php echo$this->__('Be the first to review this product') ?>
</a>
</p>
<?php endif; ?>
Now to display product offer scope, open the following file: app/design/frontend/[package/[theme]/template/catalog/product/view/type/default.phtml Add this code at the start of the code, after the initial comments (which should be around line 28):
<span><?php echo$this->__('Out of stock') ?></span>
</p>
<?php endif; ?>
And at the end of the file, add this code: </div><!—Offer Div ends --> To add the price, open this file: app/design/frontend/[package]/[theme]/template/catalog/product/price.phtml Make sure you add the proper attributes for the code in each instance of the classes price and regular-price. For each instance of span with the class price we’ll add the highlighted itemprop tag in it:
Using techniques like this, you can also add breadcrumbs to your rich snippets. An excellent tutorial on this is Google Rich Snippets in Magento. Don't forget to test simultaneously while implementing these schemas. You can use the free testing tools of Google and Bing for testing purposes. Once you have implemented all these rich sinppets into your Magento store, you’ll notice a significant rise in your website traffic if you are already ranking well in search engines.
Conclusion
So far, we should have a fully SEO-optimized Magento website with very good page load time and professional looking search results. In the next article in this series, I’ll explain some SEO considerations for creating a multi-store setup for Magento, and give a quick overview of some useful Magento extensions for SEO purposes.
IPV6 OSPF Configuration on Gns3: This is the simple IPV6 tutorial for configuring IPV6 and OSPF for IPV6 on Gns3. You must enable IPV6 routing on router by using command “ipv6 unicast-routing”, all other command are same like normal IP configuration but just replace IP with IPV6 in all commands. I use the c7200 IOS for this lab. Configure the topology as below: R1 Configuration: R1(config)# ipv6 unicast-routing R1(config)# ipv6 router ospf 1 R1(config-router)# router-id 1.1.1.1 R1(config-router)# exit R1(config-if)# interface Loopback1 R1(config-if)# ipv6 address 2001:211:10:1::1/64 R1(config-if)# ipv6 ospf 1 area 0 R1(config-if)# interface Serial1/0 R1(config-if)# ipv6 address 2001:210:10:1::2/64 R1(config-if)# ipv6 ospf 1 area 0 R2 Configuration: R2(config)# ipv6 unicast-routing R2(config)# ipv6 router ospf 1 R2(config-router)# router-i...
I'm going to discuss how I like to implement a rope-swinging gameplay mechanic. When I started working on Energy Hook I mostly did everything with my own custom code. I believe it's possible to simply go into Unity and use the Configurable Joint to do some very similar stuff, but at the time it wasn't available. I'm pretty sure this has been the right call, anyway, because it gives me control over everything - and I can share it with you. The fundamentals of doing swinging the way I did - using constraints - are actually quite simple. (Hope you're not disappointed when you see what's under the hood.) It works the same whether you're making a 2D game or 3D game, it's just that the vectors are different, so I'll start off with 2D and then discuss some wrinkles when going to three dimensions. This article also assumes you're using a game engine like Unity that can do a lot of the work for you, like raycasting against geometry and orienting a chara...
In this tutorial, we are going to design a set of icons in Adobe Photoshop. An icon set needs to have the same background and theme. For learning purposes, we are going to design a sun icon, an ice flake icon, and an RSS icon. Let's get started. 1. Preparing the Canvas Step 1 Start by making a new file with size 350 px × 350 px . Click the small box next to the Background Contents option to change the new canvas color. Step 2 In the Color Picker dialog box, select grey ( #e0e0e2 ) for the canvas background color. Step 3 It is always a good idea to keep your work structured from the start. Make a new layer group and name it sun . This is where we will place all layers used in the sun icon. 2. Designing the Icon Base Step 1 Use the Rounded Rectangle Tool to draw a rectangle with size 83 px × 64 px and 8 px radius. To get accurate results, use the Properties panel. In this panel, you can simply enter the exact siz...
Very nice Blog. Thanks for sharing with us. Want to know more about the Data Management and Auto parts, You can Visit https://apaengineering.com/technology/pim-softwares/pmt/
ReplyDelete