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.
As the music begins to play, a soft breeze fills the space with the undeniable smell of magnolia blossoms. She gracefully enters and begins a “tree pose” with her hands in Namaste form. Our female figure is inspired by the Indian culture for its gorgeous use of color and the grace of its yoga formations. I hope you’ll enjoy the journey as we retrace, step by step to enlightenment. 1. Becoming Flesh and Blood Step 1 Our first step will be to bring in our sketch. I've scanned her in at 300 dpi to catch as much of the detail as possible. I'm not as picky about my choice of initial drawing tools, and this particular project was completed with a mechanical pencil. We'll be working with a clean line quality from Adobe Photoshop and now we can begin to work. I'm working in Adobe Illustrator at a size of 8.5 x 11 inches for this specific project. When I'm ready to start my layers, I'll label my first layer as "Sketch" and lock the layer to make su...
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...
Most Android devices don't have a physical keyboard. Instead, they rely on a virtual or soft keyboard to accept user input. If you're into Android personalization, knowing how to build a custom, soft keyboard can take your hobby to a whole new level. Using the Android SDK, you can quickly create a soft keyboard with surprisingly few lines of code, because the SDK takes care of a lot of the low level tasks, such as recognizing key touches, drawing the keyboard, and establishing connections between the keyboard and input fields. In this tutorial, you will learn how to create a fully functional soft keyboard that can serve as your Android device's default keyboard. 1. Prerequisites You will need the Eclipse ADT Bundle installed. You can download it from the Android Developer website. 2. Create a New Project Fire up Eclipse and create a new Android application. Call this application, SimpleKeyboard . Make sure you choose a unique package n...
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