39 votes
Accepted

Site loading speed is very slow

First determine if it's front end rendering or the actual script execution that is slow. Check with the developer console in your browser for the Time To First Byte. This is how long the script take ...
user avatar
  • 37.4k
12 votes

Site loading speed is very slow

Site speed optimization in Magento is very vast topic. This is one link which can help you, http://www.gxjansen.com/blog/101-ways-to-speed-up-your-magento-e-commerce-website/ Taking a gist of it, ...
user avatar
  • 2,546
9 votes

Magento 2 How to do gzip compression and minify js, css files for optimization?

I'm not an expert in this field, but I will share my experiences: You need to have mod_deflate enabled in your Apache web server to utilize the compression declared in default Magento 2 .htaccess ...
user avatar
  • 2,707
8 votes

Magento2 : Manage and understand images of deleted products behavior?

After many hours of reading, digging and testing, I finally understood how Magento2 handle products images. catalog_product_entity_media_gallery table content records of all images uploaded for ...
user avatar
  • 681
6 votes
Accepted

How to add the MAGE_INDEXER_THREADS_COUNT environment variable to env.php?

You can try adding like 'MAGE_INDEXER_THREADS_COUNT'=>3 then the env.php will look something like following return [ 'backend' => [ 'frontName' => 'magento226administrator' ],...
user avatar
  • 8,548
6 votes

Magento 2: I am not aware about Magento optimization. Can you please share the steps for this?

Switch your website to production mode Minify your HTML, CSS and js files. Merge your CSS and JS files. Optimize your images. Enable Gzip Compression. Ensure if Magento Full Page Cache is enabled....
user avatar
  • 2,020
5 votes

Reduce Number of Requests

what you can try: CSS sprites to merge many images into one. inline small CSS/JS files right into HTML. use base64 data for small images https://css-tricks.com/data-uris/ CDN or domain sharding https:...
user avatar
5 votes

Magento 2 How to do gzip compression and minify js, css files for optimization?

Compare your htaccess code it must contains. <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ...
user avatar
5 votes
Accepted

How to enable CSS Critical Path in Magento 2

This will probably be added in v2.3.3. This is the MR: https://github.com/magento/magento2/commit/fb9a02ae025d102744857f981b702c0fe32c23d2
user avatar
4 votes

I need fastest product update

Firstly you could change _getid($sku) with Mage::getModel('catalog/product')->getIdBySku() which would be a bit more efficient. Basically your function updates a group of products price yeah? When ...
user avatar
  • 4,392
4 votes
Accepted

What is the best approach to call a static block in a template file and why?

There at least 10 more ways we can do it ;) In my opinion, the best way is method 1: Templates should, ideally, only contain HTML and echoing of variables, child blocks, or contain very simple ...
user avatar
  • 3,087
4 votes
Accepted

What is faster - getting raw attribute value or use collection?

Well you can test is easily, create the following test.php file in your root folder: <?php //some settings error_reporting(E_ALL | E_STRICT); define('MAGENTO_ROOT', getcwd()); $mageFilename = ...
user avatar
4 votes

Reduce Number of Requests

You have to use lazy load functionality for homepage, It is presumed there are number of products you showing on homepage and all product images have separate request. You have to go with this : ...
user avatar
4 votes

how to optimize magento 1.9.X website?

Follow these tips below on how to speed up Magento and keep it running fast to ensure return shoppers and sales. Speed Up Magento Index Latest Version Content Delivery Network Utilize Caching Enable ...
user avatar
  • 1,957
4 votes

Magento unable to add webp images to category thubmnail

I almost feel it is spammy, but just to mention: A free way of implementing WebP is here: https://www.yireo.com/software/magento-extensions/webp2
user avatar
4 votes

Magento 2 increase site speed

Some important points for speeding up Magento 2:: Production Mode Full Page Cache Minify JS and CSS Check TTFB and try to reduce it Enable Flat Categories and Products Enable GZIP ...
user avatar
  • 1,685
4 votes

Magento 2.2.2 site loading speed is very slow

You need to check following things for improve site speed in Magento: Update latest version of Magento 2 Enable Varnish Cache Configure Memcached Enable Flat Categories and Products Merge & ...
user avatar
3 votes
Accepted

Raw sql query vs Mage::getModel('catalog/product') vs?

Loading configuration cache, initializing store models etc. produces a certain overhead, so you will never get to memory usage as low as your minimal PHP script. As an example I created a script that ...
user avatar
3 votes

What are some code optimization tips?

Generally, you shouldn't ever be editing Core (or making any of the other common mistakes new Magento developers often make when attempting to customize / improve performance), if for no other reason ...
user avatar
3 votes

how to optimize load all categories with image

I don't know whether this even works, but you can try to work with Mage_Catalog_Model_Resource_Category_Tree This class should give you the possibility to traverse the tree, but after loading all the ...
user avatar
3 votes

Magento goes first the HTTP then redirects to HTTPS

The 0.3-0.5 seconds delay seem to be coming from magento internal redirect, so I would recommend using your server .htaccess to do your redirecting See htaccess redirect Add the top of your ....
user avatar
3 votes
Accepted

Correct cache for Magento and settings

it's probably worth differentiating between APC and Memcached so that you understand the difference. Note that you also have both Memcache and Memcached. Of these 2 Memcache is the older option with ...
user avatar
3 votes
Accepted

Magento 1.7 + Apache + 2GB RAM super slow with new theme

In my experience, bought themes are very often put together without following Magento's best practices or built with flexibility in mind more than performance. We've often decided to just theme a ...
user avatar
3 votes
Accepted

Speed up magento by htacess

You need to add compression code into you .htaccess file just like mine as below: ############################################ ## uncomment these lines for CGI mode ## make sure to specify the ...
user avatar
  • 1,984
3 votes

Does magento2 use r.js optimization for require.js when deploying static files

Yes. It could be optimized by using r.js Anton Krill showed a basic implementation here https://github.com/antonkril/magento-rjs-config - however Magento team is working on new external bundling ...
user avatar
3 votes
Accepted

How do you minify merged css and js on Magento 1.9?

If you are in Magento 1.x, i would ignore the merging for css and js files. That functionality breaks more things that it fixes. There is no built in minification for Magento 1.x, so you will have to ...
user avatar
  • 4,133
3 votes

What is faster - getting raw attribute value or use collection?

Bit different numbers here. "xhprof'ed" with with ~700 products .... $storeId = 1; $productIds = Mage::getModel('catalog/category')->load(41) ->getProductCollection() ->getAllIds(); ...
user avatar
  • 11.5k
3 votes
Accepted

Image optimizer Magento1.9.3.2

Check if the optipng binary is available: which optipng If it was found, make sure it has the correct access permissions: chmod +x PATH_FROM_optipng
user avatar
3 votes
Accepted

Magento 2 : page speed optimization

Firstly you if want good magento pagespeed, the store must be set to production mode using following command; php bin/magento deploy:mode:set production Now, for caching you can use magento's ...
user avatar
  • 4,585
3 votes

How to add the MAGE_INDEXER_THREADS_COUNT environment variable to env.php?

Works if you insert below 'MAGE_MODE' with: 'x-frame-options' => 'SAMEORGIN', 'MAGE_MODE' => 'production', 'MAGE_INDEXER_THREADS_COUNT' => '3', 'session' => [ 'save' => 'memcache', ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible