LiteMage Cache is the world's fastest full page cache for Magento. The LiteMage Cache extension for Magento uses an improved version of LiteSpeed Cache to deliver superior caching using ESI implementation geared specifically for Magento pages.
This wiki will guide you through all the steps needed to install and set up the components of LiteMage Cache.
LiteMage setup is easy for both dedicated and shared hosting environments. Here are the basic steps.
At the server level, you will need to:
For each Magento Store, you will need to:
If you need any additional support or help installing and configuring LiteMage for your Magento store, have a look at our LiteMage Support page.
Server level cache storage needs to be configured properly for your environment. Select your server setup from the Web Server Configuration section of our LiteSpeed Cache Installation Guide and follow the instructions in the Set Server Level Cache Root section of your respective guide.
The LiteMage module needs to be enabled for each Magento store. Add the code below to the .htaccess file under the root directory of each Magento installation:
<IfModule Litespeed> LiteMage on </IfModule>
LSWS 5.1.10 or Later - Setting “LiteMage on” in the code block above will cause the server to attempt to use shared private cache information to speed up page load times for first time visitors. This feature is only supported as of LiteMage 1.3.0 . If you are using an older version of LiteMage or want to disable this feature, change “LiteMage on” to “LiteMage safe”.
Note: If your .htaccess file is ever overwritten you must re-add this code for LiteMage to work.
Of course you will need to verify if .htaccess files have been enabled in the Apache configuration if LiteSpeed is running off of it.
Check your Apache configuration file for the related “Virtual Host” section and make sure the following is set:
<Directory /path/to/your/magento_store_installation> AllowOverride All </Directory>
Note: If set to “AllowOverride None”, .htaccess files will be disabled. Therefore LiteMage will not be enabled even if you place “LiteMage on” in .htaccess.
For cPanel users: The auto-generated main configuration file in /usr/local/apache/conf/httpd.conf may include other files like “/usr/local/apache/conf/userdata/std/2/test123/test123.com/*.conf”. You need to check all included files to ensure that .htaccess is enabled.
Alternatively, the enable code can be placed in the virtual host conf section instead of in .htaccess.
The LiteMage extension for Magento needs to be installed for each Magento installation. Varnish cache and other full page caches must also be disabled ( including Magento built in full page cache ). Normally locate the xml file for the modules located at app/etc/modules/, For example, Extendware_EWPageCache.xml, and change <active>true</active>
to <active>false</active>
. Alternatively, you can rename the xml to other name such as adding .disable
to it: mv Extendware_EWPageCache.xml Extendware_EWPageCache.xml.disable
. You will need to go to system→cache management→ Configuration (refresh the configuration) and flush the cache storage .
Note: Updating LiteMage will overwrite LiteMage's config.xml file; be sure to backup your config.xml file if you have made any customizations before updating LiteMage.
Note: If you are using any of our other LiteSpeed Cache plugins, please see Handling Logged-in Cookie Conflicts.
Notes:
No
and refresh the configuration cache again.Your installation of LiteSpeed Web Server does not have LiteMage enabled.
error message, make sure that your LSWS has the LiteMage module and that you have enabled LiteMage in your Magento .htaccess
file. (Refer to the Turn on the LiteMage Module step above).Enabled
under System > Cache Management. If you are using Magento Enterprise, you must also Disable
Page Cache.Enabled
to start, but if it causes trouble, you can set it to Disabled
.
Note: If you have made any customizations to LiteMage's "config.xml" file, you should first create a backup of this as it will be overwritten during the update process.
We suggest testing LiteMage in a pre-production environment. If you have to test LiteMage on a live site, be sure to use Enable LiteMage Cache Only for Listed IPs. This setting specifies certain IPs that will test caching while other IPs are served normally.
Use your browser's developer tool to check the response header for the HTML file. This can usually be done by right clicking on the page and selecting some form of “Inspect”. Then click on the “Network” tab in the inspector and reload the page. If you see “X-LiteSpeed-Cache: hit,litemage” in the response header for the HTML file(usually listed first), then the page is being served by LiteMage Cache. You should see “X-Litespeed-Cache:miss” for the first time visit page, then if you refresh the page, you should see “X-LiteSpeed-Cache: hit,litemage”. If this is not the case, please verify if there is any step missed from above, or try this wiki for troubleshooting steps.
If you see something like x-litespeed-cache-control:public,max-age=86400
and x-litespeed-tag
after refresing a few times but still no x-litespeed-cache:miss,litemage
or x-litespeed-cache:hit,litemage
, the common reason is a cache root permission problem. virtual host cache root is normally set to /home/$USER/lscache
and it should be owned by nobody:user
instead of user:user
. If somehow you manually created this directory with user:user
ownership, or you manually changed it to user:user
ownership, there will be a cache module write permission issue as described above. You may also encounter the issue with some old cache files. To fix the problem, remove the /home/$USER/lscache
folder completely and restart the web server. The cache root folder (normally /home/$USER/lscache
) will be created with correct ownership and permissions automatically during the restart. After restart, you should see the x-litespeed-cache:hit,litemage
header.
You can setup cache warmup to warmup your litmage to ensure visitors' browsing served from cache instead of backend php and avoid “X-Litespeed-Cache:miss”.
The default configuration for the LiteMage extension should work with most Magento installations out-of-box. If you need any additional support or help installing and configuring LiteMage for your Magento store, have a look at our LiteMage Support page.