Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cache:litemage_configuration [2015/07/21 20:05]
Michael Alegre
litespeed_wiki:cache:litemage_configuration [2015/07/27 14:47]
Michael Alegre removed
Line 51: Line 51:
 **__Custom ESI Block Structure__** \\ **__Custom ESI Block Structure__** \\
  
-ESI blocks are grouped by common purge events. If you feel as though none of the current groupings fit what you want to accomplish, you can add your own custom grouping to LiteMage'​s "​config.xml"​ file. The general structure for an ESI block is:+ESI blocks are grouped by common purge events. If you feel as though none of the current groupings fit what you want to accomplish, you can add your own custom grouping to the <​frontend>​ -> <​litemage>​ -> <​esiblock>​ section of LiteMage'​s "​config.xml"​ file. The general structure for an ESI block is:
  
   <Unique Group Tag>   <Unique Group Tag>
Line 65: Line 65:
   * **<​blocks>:​** A combination of block types (where all blocks that inherit this type will automatically be included) and individual block names.\\   * **<​blocks>:​** A combination of block types (where all blocks that inherit this type will automatically be included) and individual block names.\\
   * **<​purge_events>:​** A combination of events present in the <​frontend>​ -> <​events>​ section that, when triggered, will cause this grouping of blocks to be purged.\\   * **<​purge_events>:​** A combination of events present in the <​frontend>​ -> <​events>​ section that, when triggered, will cause this grouping of blocks to be purged.\\
-  * **<​purge_tags>:​** A list of the "​Unique Group Tags" of other ESI block groupings. The purge events ​of any grouping present in this list will also cause this grouping to be purged.+  * **<​purge_tags>:​** A list of the "​Unique Group Tags" of other ESI block groupings. The triggering of purge events ​for any grouping present in this list will also cause this grouping to also be purged.
  
  
Line 72: Line 72:
 **__Custom Purge Events__** \\ **__Custom Purge Events__** \\
  
-If you would also like to add a new purge event for this grouping, you can do so by adding the event and its observer to the <​frontend>​ -> <​events>​ section ​of LiteMage'​s "​config.xml"​ file. The general structure for a purge event is:+If you would like to add additional ​purge events not currently present in LiteMage'​s "​config.xml"​ file, you can do so by adding the event and its observer to the <​frontend>​ -> <​events>​ section. The general structure for a purge event is:
  
-  <Unique ​Event Tag>+  <Magento ​Event Tag>
     <​observers>​     <​observers>​
       <​litemage_esi>​       <​litemage_esi>​
Line 81: Line 81:
       </​litemage_esi>​       </​litemage_esi>​
     </​observers>​     </​observers>​
-  </Unique ​Event Tag>+  </Magento ​Event Tag>
  
 Where: Where:
-  * **<Unique ​Event Tag>:** The unique ​name you want to assign this purge event. ​+  * **<Magento ​Event Tag>:** The name of a new existing Magento ​event not currently present in the <​events>​ section.
  
-This uses the predefined "​purgeEsiCache"​ method to purge any ESI blocks ​using this purge event from the cache whenever this event is triggered.+This uses the predefined "​purgeEsiCache"​ method to purge any ESI block groupings that are using this purge event from the cache whenever this event is triggered.
    
 +===== Single Language Sites =====
 +
 +LiteMage'​s "​config.xml"​ file contains a rewrite for Magento'​s translate line to fix a bug. If you intend to only use a single language for your store, you may remove this rewrite for a possible performance improvement. The rewrite is located near the start of "​config.xml"​ in <​config>​ -> <​global>​ -> <​models>​ and will look like the following:
 +
 +  <​core>​
 +    <​rewrite>​
 +      <​translate>​Litespeed_Litemage_Model_Translate</​translate>​
 +    </​rewrite>​
 +  </​core>​
  
 ====== Important Note About Updating ====== ====== Important Note About Updating ======
Line 93: Line 102:
 Updating LiteMage will overwrite LiteMage'​s "​config.xml"​ file. Before you update, make sure to copy and save your "​config.xml"​ file if you have made any customizations. Updating LiteMage will overwrite LiteMage'​s "​config.xml"​ file. Before you update, make sure to copy and save your "​config.xml"​ file if you have made any customizations.
  
 +====== Magento Configuration =====
 +
 +  * For LiteMage to work correctly, you must have both "​Configuration"​ and "​Layouts"​ enabled under System -> Cache Management in the Magento Admin Panel. If you are using Magento Enterprise, you must also disable "Page Cache"​.
 +{{ :​litespeed_wiki:​cache:​magento-cache-management-li-80-e.png?​nolink |}}
  
 ====== LiteMage Extension For Magento Configuration ===== ====== LiteMage Extension For Magento Configuration =====
  
   * LiteMage'​s default configuration should be suitable for testing. ​   * LiteMage'​s default configuration should be suitable for testing. ​
-  * Please ​read the comments for each configuration option before adjusting them.  +  * Always ​read the comments for each configuration option before adjusting them.  
-  * Detailed notes on certain settings are also provided in the "Notes on Specific Configuration Settings"​ section below.+  * Detailed notes on certain settings are provided in the "Notes on Specific Configuration Settings"​ section below.
  
 +===== When Changing LiteMage Configuration =====
  
-===== Notes On Specific Configuration Settings =====+**__In The Magento Admin Panel__**\\
  
-  * Default Private Cache TTL: Should not be set higher than the Cookie Lifetime setting (System -> Configuration -> Web). The default Cookie Lifetime value is 3600. +After making any changes to LiteMage ​through ​the Magento ​Admin Panel, always Flush the LiteMage ​cache by navigating ​to System -> Cache Management ​and, under "LiteMage Cache Management, clicking "Flush LiteMage Cache".
-  * Enable Cache Warm Up: Because ​LiteMage ​is encrypted, ​the Magento ​cron.sh must use a PHP with IonCube Loader. Updating ​the cron.sh PHP_BIN setting to "​PHP_BIN=/​usr/​local/​lsws/​fcgi-bin/​lsphp5"​ will connect it to LSWS's PHP. (How to set up the Magento cron job: http://​www.magentocommerce.com/​wiki/​1_-_installation_and_configuration/​how_to_setup_a_cron_job )  +
-  * Enable ​LiteMage ​Cache Only for Listed IPs: This setting is used to allow administrators to test caching from certain IPs on a production server. When you are ready to use LiteMage Cache for all users, leave this setting blank. After updating this setting, flush LiteSpeed'​s cache (System -> Cache Management). This will get rid of the cached copies made during testing (which cannot be served to normal users). +
-  * Flush LiteMage Cache: The Flush LiteMage Cache button (under System -> Cache Management) flushes all public and private caches. Cache Warm Up (if enabled) will also be started automatically after the cache is flushed. +
-  * Each Magento installation requires a unique cache storage. If your server hosts multiple Magento installations,​ you must set up different cache storage paths for each installation. Follow the steps below to do so: +
-    * If you are using LiteSpeed-native virtual hosts, different storage paths can be set in the WebAdmin -> Configuration -> Virtual Hosts -> your virtual host -> Cache ->​Storage Path setting. +
-    * If you are using Apache configuration files, different cache storage paths can be set using the CacheRoot directive in your Apache virtual host configurations as follows (This must be put in the virtual host include file, .htaccess cannot be used.): +
  
 +**__In The "​config.xml"​ File__**\\
 +
 +After Making any changes to LiteMage through it's "​config.xml"​ file, you must do the following:
 +
 +  - From the Magento Admin Panel, navigate to System -> Cache Management.
 +  - Check the box next to "​Configuration"​ and check that "​Refresh"​ is selected in the drop-down menu on the top right before clicking "​Submit"​.
 +  - Near the bottom of the page under "​LiteMage Cache Management",​ click "Flush LiteMage Cache"​.
 +
 +===== Cache Storage =====
 +
 +Each Magento installation requires a unique cache storage. If your server hosts multiple Magento installations,​ you must set up different cache storage paths for each installation. Follow the steps below to do so:
 +    * If you are using a LiteSpeed-native virtual hosts, different storage paths can be set in the WebAdmin -> Configuration -> Virtual Hosts -> "​Your_Virtual_Host"​ -> Cache ->​Storage Path setting.
 +    * If you are using Apache configuration files, different cache storage paths can be set using the CacheRoot directive in your Apache virtual host configurations as follows (This must be put in the virtual host include file, "​.htaccess"​ cannot be used.): ​
  
   <​IfModule Litespeed>​   <​IfModule Litespeed>​
   CacheRoot /​path/​to/​vhost/​cache/​root/​   CacheRoot /​path/​to/​vhost/​cache/​root/​
   </​IfModule>​   </​IfModule>​
 +\\
 +**For shared-hosting providers:​** It is also recommended to set a different cache storage for each user under their home directories. This gives each user full control of their cache directories,​ enabling them to do things like deleting the whole cache directory for example. To do this, include the following in the Apache config file for each virtual host:   
 +  <​IfModule LiteSpeed>​
 +  CacheRoot litemage_cache
 +  </​IfModule>​
 +LiteSpeed will assume the home directory by default, creating a cache directory in each user's home directory called "​litemage_cache"​. For example: /​home/​user1/​litemage_cache.
 +
 +**For shared-hosting providers also using cPanel:** You can instead place the above CacheRoot section in an Apache include file (such as litemage.conf) under /​usr/​local/​apache/​conf/​userdata.
 +
 +===== Notes On Specific Configuration Settings =====
 +
 +  * **Default Private Cache TTL:** Should not be set higher than the Cookie Lifetime setting (System -> Configuration -> Web). The default Cookie Lifetime value is 3600.
 +  * **Enable Cache Warm Up:** Because LiteMage is encrypted, the Magento cron.sh must use a PHP with IonCube Loader. Updating the cron.sh PHP_BIN setting to "​PHP_BIN=/​usr/​local/​lsws/​fcgi-bin/​lsphp5"​ will connect it to LSWS's PHP. (How to set up the Magento cron job: http://​www.magentocommerce.com/​wiki/​1_-_installation_and_configuration/​how_to_setup_a_cron_job ) 
 +  * **Enable LiteMage Cache Only for Listed IPs:** This setting is used to allow administrators to test caching from certain IPs on a production server. When you are ready to use LiteMage Cache for all users, leave this setting blank. After updating this setting, flush LiteSpeed'​s cache (System -> Cache Management). This will get rid of the cached copies made during testing (which cannot be served to normal users).
 +  * **Track Recently Viewed Products:** Recommend setting to "​No"​ if your template does not show last viewed items. If set to "​Yes";​ every time a product page is viewed it must be recorded in Magento'​s backend database, initializing the Magento framework and greatly slowing down the site. If you would like to know how to disable the "​recently viewed products"​ block from your template, try this guide from [[http://​www.templatemonster.com/​help/​magento-how-to-remove-recently-viewed-products-block.html|TemplateMonster]]
 +  * **Flush LiteMage Cache:** The Flush LiteMage Cache button (under System -> Cache Management) flushes all public and private caches. Cache Warm Up (if enabled) will also be started automatically after the cache is flushed.