Overview
This guide demonstrates how to optimize magento performance. Most optimizations will work with any version of magento. Those intended for specific versions will be indicated as such.
Tweak. htaccess
The default. htaccess file that comes with magento has several sections dealing with performance. The following deployments are commented out and must be enabled to realize their benefit.
Enable output Compression
This section will turn on the Apache mod_deflate module, which compresses text, CSS, and JavaScript before it is sent to the browser. this achieves a smaller download size. to enable, simply uncomment the appropriate lines so that it looks like the following:
############################################## enable apache served files compression## http://developer.yahoo.com/performance/rules.html#gzip # Insert filter on all content SetOutputFilter DEFLATE # Insert filter on selected content types only AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don‘t compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don‘t deliver the wrong content Header append Vary User-Agent env=!dont-vary
Enable expires Headers
Attention:This will not work on litespeed servers.
Browsers use expires headers to determine how long a page component can be cached. static components, like images, shocould have far-Future expires headers, but all page components shocould have expires headers. to activate this feature, uncomment the appropriate line and add expiresactive on directly abve it:
############################################## Add default Expires header## http://developer.yahoo.com/performance/rules.html#expires ExpiresActive On ExpiresDefault "access plus 1 year"
Disable etags
Etags are a way for browsers to validate cached components into SS subsequent visits. they can slow down a site served from a cluster if the cluster has not implemented them properly. it is best to disable them as follows:
############################################## If running in cluster environment, uncomment this## http://developer.yahoo.com/performance/rules.html#etags FileETag none
Magento administrative tweaks
Generally, these features are available on versions 1.4.0.1 and higher and shoshould be completed MED after completing the majority of developmental tasks.
Combine CSS and JS files
This feature has CES the number of HTTPRequests. For versions earlier than 1.4.x, use the fooman_speedster extension instead.
Attention:Combining CSS/JS when using CDN will cause CSS/JS to "break" until the CDN updates completely. nexcess recommends starting this process at the beginning non-peak hours to allow enough time for the "new" CSS/JS to reach the CDN.
- In the magento admin, selectSystem> Configuration> developer.
- UnderJavascript settings, ChangeMerge JavaScript filesToYes.
- UnderCSSSettings, ChangeMerge CSSFilesToYes.
- Clear the cache.
Enable flat catalog
Magento uses the EAV model to store customer and product data. This enables these objects to be incredibly extensible, but results in longer SQLQueries and more reads. enabling the flat catalog for categories and products merges product data into one table, thereby improving performance. generally, all stores shocould enable flat catalog for categories. stores with over 1000 Products shocould enable flat catalog for products.
- From the magento administator interface, goSystem> Configuration> catalog.
- UnderFrontend, Change "use flat catalog category"Yes.
- If desired, underFrontend, Change "use flat catalog product"Yes.
- Clear the cache.
Other performance tweaksconfigure the nexcess CDN
For details, refer to how to configure the nexcess CDN with magento.
Clean the database
Magento's database can quickly become sluggish due to unmaintained log Tabes. Refer to magento database maintenance for information regarding database maintenance.
Posted-mon, Jul 29,201 3 at pm
Filed under: magento
-See More: http://docs.nexcess.net/article/optimizing-magento-performance.html#sthash.gGcybDSA.dpuf
Http://www.magespeedtest.com/
How to optimize magento Performance