CAll Us: +1 888-999-8231 Submit Ticket

WooCommerce Performance Optimization: 5 Things You Should Be Doing Right Now

Building a blazing fast WooCommerce store used to be a full-time job. Now, basic WooCommerce performance optimization is simply a matter of knowing what technologies and plugins to use to keep your store speedy and your customers engaged. Here’s an intro to five performance topics and related resources for successfully optimizing your online store.

Shouldn’t I start with caching?

When looking at WooCommerce performance optimization, it’s easy to gravitate towards caching. While caching is a necessary technique for speeding up a WooCommerce website, it’s important that what you’re caching is also optimized.

Protip: Optimize your online store before enabling caching to make troubleshooting easier!

Page optimization

How quickly a page loads can mean the difference between a sale and a bounce. It’s important to make sure that the visible area of the page loads as quickly as possible. That means that graphical flourishes, fonts, and tracking scripts should either be some of the last things to load or should load asynchronously.

Even if you defer the loading of certain parts of the website, it’s still critical that you pay attention to how a page loads. Are external resources being loaded? Are those resources fonts or something more mission critical like CSS? Make sure critical resources are loaded quickly and/or asynchronously.

A couple great plugins for this type of optimization are Async JavaScript and Autoptimize.

Database optimization

Optimizing database queries and table types is a great way to see big performance gains with minimal effort. 

Create a new Index

Indexes help the MySQL database server find information quicker. Think of it as the index at the back of an old encyclopedia, or a table of contents in a book. While too many indexes can actually slow down the database, some strategically created indexes can have dramatic performance benefits.

Consider applying this index to your WordPress website to see a lift in performance.

MyISAM vs InnoDB

Usually referred to as storage engines, MyISAM and InnoDB are two different table types available within MySQL. For WordPress, tables should be in InnoDB format to get the best performance from your database. Of course, before making any changes, remember to back up your database.

Need to convert your database tables to InnoDB? This plugin should help.

Image optimization

While it might be hard to believe, large images can dramatically decrease the performance of your website or store. It might be tempting to think that lazy loading images can fix the problem, but remember that every image within the currently viewable area of a website must load for your user to have a good experience. In-fact, image size makes an even bigger difference when a user is visiting your website from their mobile device because network conditions and speeds are different in every place on earth. Luckily there are great plugins that can help optimize your images!

TinyPNG, Imagify, EWWW, Shortpixel, and Robin Image Optimizer are a few great image optimization plugins.

Caching

WordPress used to be just a blogging platform. As WordPress has evolved into a capable platform for building stores, learning sites, etc, so has the need for caching. You can learn about this important aspect of WooCommerce performance optimization by checking out the caching in WooCommerce article on the Hostdedi blog.

Multi-threading

If you’ve ever been in a busy supermarket wishing they’d open up another checkout lane, you already understand the idea behind multi-threading. Because a PHP process works on commands in a linear way, a growing site will eventually grind to a halt as a single PHP process becomes overwhelmed. If you add more processes, the website is capable of responding to more requests concurrently, and the system starts to move again. WordPress hosts like Hostdedi use PHP worker processes to enable multi-threading for fast concurrent requests. For a more in-depth look at worker processes and how they work, check out this article. If you’re feeling extra cool, you can even try your hand at implementing workers using the official PHP documentation.

Remember to test your optimizations

As a final thought, remember to test the speed of your website before and after optimizations. While there are many resources for testing page speed, GTMetrix is a great place to start your journey. And remember, if you need help along the way, get in touch. We are here to help!

Source link

The Ultimate Magento 2 Performance Checklist



At Hostdedi, we spend a considerable amount of time optimizing our infrastructure to make your Magento 2 store faster. After years of research and development, we’ve pulled together the ultimate Magento 2 performance checklist:

  1. Remove unused modules: Magento 2 comes with many pre installed modules that aren’t always needed. Yireo created a great module to disable the optional modules you don’t need through composer. The idea behind the module is quite simple: you replace any unused module with nothing to avoid loading unused modules and classes. This module and a complete how-to can be found here: https://github.com/yireo/magento2-replace-tools
  1. Enable CSS/JS minification and merging: Minifying and merging CSS files can greatly improve load times and the general performance of your store by cutting the number of requests your site makes when loading a page. You can minify and merge CSS and JS files from the admin panel by navigating to the Developer tab under Stores > Configuration > Advanced (keep in mind this tab will only show if you are using developer mode). Magento recommends using a 3rd party plugin like Baler or MagePack for JS bundling given that Magento’s bundling mechanisms are not optimal and should only be used as fallback alternatives.
  1. Enable production mode: While this one might seem simple, the number of sites we see using a different mode in Magento is staggering. No one should be running Magento 2 in production in a different mode, but we still see too many stores running on either default or developer mode. The best way to switch modes is via CLI: 

php bin/magento:deploy:mode:show

to see which mode is your store using and 

php bin/magento deploy:mode:set production

to set production mode

  1. Use Redis for session/default and full page cache: Redis is one of the most used key/value database engines and Magento 2 comes with integrated support to use it as a both session storage and default/full page. To configure your store to use Redis, run the following commands from your root folder:

bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-<parameter_name>=<parameter_value>...

bin/magento setup:config:set --session-save=redis --session-save-redis-<parameter_name>=<parameter_value>...

You can find a complete list of Redis configuration parameters and values for sessions here and for the full page cache here

  1. Use Elasticsearch for Magento’s catalog search: Since Magento 2.4, MySql was deprecated (and removed) and Elasticsearch was introduced as the catalog search engine, greatly improving the speed and results of the searches. To enable Elasticsearch, navigate to your admin panel and under Stores > Settings > Configuration > Catalog > Catalog > Catalog Search you will find a tab called Search Engine. Configure your store to use your Elasticsearch endpoint, click Test connection and if everything worked, you’re all set. You can find the complete list of parameters to configure Elasticsearch here.
  1. Use Varnish to speed up your response time/TTFB: You either love or hate Varnish but at the end of the day, it greatly improves the TTFB, and if configured correctly, it can do wonders for the general usability and user experience of your site. Magento 2 features an out of the box integration, making Varnish configuration really simple. To configure Varnish, navigate to Stores > Settings > Configuration > Advanced > System > Full Page Cache, select Varnish from the Caching Application list and configure the rest of the options. A full list of all the parameters you can use to configure Varnish can be found here

You can also configure Varnish from the CLI by running:

php bin/magento config:set --scope=default --scope-code=0 system/full_page_cache/caching_application 2

  1. Use a CDN: A content delivery network is normally used to store media and static assets at edge servers near your customers for faster delivery. This means your assets are physically closer to your customer, resulting in faster response times. Configuring a CDN for Magento is not as straightforward as it should be but it can be achieved by using the admin and navigating to Stores > Settings > Configuration. Under General, click on Web and expand the Base URL sections. Once there, update the Base URL for Static View Files and Base URL for User Media Files with the URL of your CDN endpoint where static view and javascript files are stored. Do the same for Base URLs (Secure) and once done, click Save config. You might need to flush/clean your cache for this change to take effect. If everything worked as expected, you should be seeing your CDN url being used to serve most of your site’s static files.
  1. Enabling the Asynchronous email notifications, Asynchronous order data processing: during times of high concurrency, you might want to move processes that handle checkout, order processing email notifications and stock updates to the background. To enable async email notifications, go to Stores > Settings > Configuration > Sales > Sales Emails > General Settings > Asynchronous Sending

You can activate Asynchronous order data processing from Stores > Settings > Configuration > Advanced > Developer > Grid Settings > Asynchronous indexing

When enabled, orders will be placed in temporary storage and moved in batch to the Order grid without any collisions.

While there are no real magic tricks, we tried this guide in our cloudhosts and ended up with an A and a page load under 2 seconds on GTMetrix 🥳

If you’d like assistance enacting these changes, or are interested in our Managed Magento offering, please reach out to our award-winning support team 24/7/365 at [email protected].

Source link