LiteSpeed & LiteMage for Magento (Firstserv Guide)

All Firstserv shared and business hosting servers run LiteSpeed Web Server, delivering high performance out of the box. On Business hosting plans that support Magento, we also provide LiteMage, a powerful caching solution designed specifically for Magento.

If you’re running a Magento store, we strongly recommend installing LiteMage to significantly improve performance and user experience.


What Does LiteSpeed / LiteMage Do?

In simple terms, caching makes your website much faster.

Without caching:

  • Each visitor request triggers the server to:
    • Load data from the database
    • Generate page content (HTML, images, scripts)
  • This takes time and uses server resources

With caching enabled:

  • A pre-built version of the page is stored
  • Future requests are served instantly from cache

✅ Result:

  • Faster page load times
  • Reduced server load
  • Improved user experience
  • Better conversion rates

Handling Dynamic Content (ESI)

Magento sites often include personalised content (e.g. customer details, cart data).

LiteMage solves this with Edge Side Includes (ESI):

  • Most of the page is served from cache
  • Personalised sections are dynamically inserted

✅ This approach—known as “hole punching”—ensures:

  • High performance
  • Accurate personalised content

Why Use LiteMage?

  • Dramatically improves Magento performance
  • Works seamlessly with LiteSpeed Web Server
  • Handles both static and dynamic content efficiently
  • Requires minimal configuration to see results

Prerequisites

Before installing LiteMage:

  • Magento 2 must already be installed
  • You must have Administrator access
  • SSH access must be enabled on your hosting account
  • Basic familiarity with the command line is recommended
  • The PHP exec function must be enabled temporarily

Installing LiteMage

Step 1: Access Your Server

  • Connect via SSH (or cPanel Terminal)
  • Navigate to your Magento root directory (e.g. /public_html)
 
 
 
 
 
 
Shell
 
 
cd public_html
 
 

Step 2: Enable Developer Mode

 
 
 
 
 
 
Shell
 
 
php bin/magento deploy:mode:set developer
 
 

Step 3: Download LiteMage Module

 
 
 
 
 
 
Shell
 
 
wget https://github.com/litespeedtech/magento2-LiteSpeed_LiteMage/archive/master.zip
 
 

Step 4: Extract Files

 
 
 
 
 
 
Shell
 
 
unzip master.zip
 
 

Step 5: Move Files into Magento Directory

 
 
 
 
 
 
Shell
 
 
mkdir -p app/code/Litespeed/Litemage
mv magento2-LiteSpeed_LiteMage-master/* app/code/Litespeed/Litemage/
 
 

Ensure file ownership matches your Magento installation. Adjust using chown if required.


Step 6: Enable the Module

 
 
 
 
 
 
Shell
 
 
php bin/magento module:enable Litespeed_Litemage
php bin/magento setup:upgrade
 
 

Step 7: Compile Magento

Run one of the following:

 
 
 
 
 
 
Shell
 
 
php bin/magento setup:di:compile
 
 

(Use setup:di:compile-multi-tenant only if required for older setups.)


Step 8: Return to Production Mode

 
 
 
 
 
 
Shell
 
 
php bin/magento deploy:mode:set production
 
 

Step 9: Enable LiteMage in .htaccess

Add the following:

 
 
 
 
 
 
Apache Config
 
 
<IfModule LiteSpeed>
LiteMage on
</IfModule>
 
 

Step 10: Disable PHP exec (Important)

Once installation is complete:

  • Disable the exec function again via cPanel
  • Leaving it enabled can create security risks

Activating LiteMage in Magento

  1. Log in to your Magento Admin panel
  2. Go to:
    Stores → Configuration → Advanced → System
  3. Locate Full Page Cache
  4. Set:
    • Caching Application: LiteMage Cache (LiteSpeed)
  5. Save settings

Refresh Cache

  1. Go to System → Cache Management
  2. Select:
    • Configuration
    • Page Cache
  3. Click Refresh

Verifying LiteMage is Working

You can confirm caching is active using your browser’s developer tools:

  1. Open Developer Tools → Network tab
  2. Load your website
  3. Click the first request and check headers

Look for:

  • x-litespeed-cache: hit,litemage → Cache working
  • ⚠️ x-litespeed-cache: miss,litemage → Refresh page (cache not yet built)

Best Practices

  • Allow time for cache to build after installation
  • Test your store functionality after enabling caching
  • Fine-tune LiteMage settings for optimal performance
  • Monitor performance improvements using tools like GTmetrix

Summary

LiteMage is a powerful Magento optimisation tool that:

  • Speeds up page loading significantly
  • Reduces server load
  • Supports dynamic content using ESI
  • Improves overall store performance

If you need assistance installing or configuring LiteMage on your Firstserv hosting, our support team is always happy to help.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring Redis caching in Magento

Object Caching and Redis for Magento (Firstserv Guide) What is Object Caching? Object...

Configuring Elasticsearch with Magento 2.4

Setting Up Elasticsearch for Magento 2.4 (Firstserv Guide) Magento 2.4 requires...

Installing LiteMage caching for Magento v1

LiteSpeed & LiteMage for Magento 1 (Firstserv Guide) All Firstserv shared and business...

Configuring Opensearch with Magento 2.4

Setting Up OpenSearch for Magento 2.4 (Firstserv Guide) Magento 2.4 requires a search engine...