Thursday, September 21, 2017

speed up Magento using .htaccess file

Speed Magento with .htaccess file

1) Enable Gzip Compression For Magento

Gzip is a method of compressing files (reducing file’s size) for faster network transfers. In your htaccess file, find.  #php_flag zlib.output_compression on  and un-comment it to enable Gzip Compression

2) Compressing CSS and JavaScript files
Compressing CSS and JavaScript files is important to speed your Magento site, we can enable compression for CSS and Java files by adding the following lines to .htaccess file:

<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
</IfModule>

Enable Expires Headers
Expire header is used here to indicate how long browser should store files for caching. Generally, we use expire headers for images file only but for Magento, we should apply expire header for all elements like script, styles or flash.

############################################
## Add Expires header to Magento - by Magentoexplorer.com
## http://developer.yahoo.com/performance/rules.html#expires
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    ExpiresActive On
    ExpiresDefault "access plus 1 year"

Disable ETags
Entity tags (ETags) help web servers and browsers use to determine if the component in the browser’s cache matches the one on the origin serverETages allow browsers to validate cached page. We can disable eTags to improve performance:
FileETag none
Disable some unwanted modules

Tuesday, September 19, 2017

Magento 2 Architecture

Magento 2 architecture

Magento architecture from different perspectives

Depending upon your role and purpose for learning more about Magento, there are several different ways to view the Magento architecture. For example, a developer who wants to create new modules or perhaps customize an existing module will want to understand the architecture of a module itself, and how it fits into the larger view, with the Magento framework and other components. However, a merchant who wants to quickly build an online store front wants to view the collection of components from a higher level, and understand the components that impact the look, feel, and user interaction components.

Architecture layers diagram

The following diagram illustrates the components of Magento, and shows the “layers” or tiers, for all components, as well as the Magento framework, 3rd party libraries, the supported database, and other technologies.


Monday, September 18, 2017

Magento 2 Reindex process

Hello Team,

Please run the below command through command prompt:

Check the current status of Indexing
1) php bin/magento indexer:status
Execute All Indexes
2) php bin/magento indexer:reindex
Reset All Indexes
3) php bin/magento indexer:reset
Index only one Index
4) php bin/magento indexer:reindex customer_grid
Reset one Index
5) php bin/magento indexer:reset customer_grid

run the following SQL query directly into the database :
UPDATE indexer_state SET status = 'valid';