How to integrate Redis into Magento v1
Knowledgebase Article
}
Knowledgebase Article
Redis is one of the several backend cache systems supported by Magento.
The way Redis works, is to cache the database queries on the first visit, and then serve the cached content to every other user that loads the same page, without querying the actual database.
The essential point of interest of utilizing Redis, is that store labels are upheld and the slower file system cache is no longer needed to be utilized.
In Magento 1.x, Redis caching can be activated by editing two system files: /app/etc/modules/Cm_RedisSession.xml and /app/etc/local.xml.
Let's start with /app/etc/modules/Cm_RedisSession.xml
That configuration file defaults to:
where you need to change that to:
Next is the /app/etc/local.xml file.
Just under your database connection settings, make sure session_save is set to DB (database):
and then enable Redis, by adding the following code (click REDIS CACHE to see the raw code ), just before the closing </global> tag:
Replace the USER in the code with your actual cPanel username, so you end up with something like this:
The host is the "Redis socket address" which you get from your cPanel >> Redis, the port is always 0, and the database must by an unique Redis database number, which is recommended to protect against data loss.
Important: If you use Redis for caching in other applications (for example, if you host multiple web sites in the same hosting account), the database numbers must be different.
You can have up to 16 Redis databases per hosting account.
The final step is to flush the Magento cache in any of the following ways:
- If you have access to the file system as the owner of the files in the Magento installation directory, change to that directory and enter rm -rf var/cache.
- Log in to the Admin Panel as an administrator. Click System > Cache Management, then click Flush Magento Cache at the top of the page.
Should you need any further assistance, please do not hesitate to contact us.
Powered by WHMCompleteSolution