1"use strict";(globalThis.webpackChunkans_co_uk_docs=globalThis.webpackChunkans_co_uk_docs||[]).push([[11673],{28453:(e,s,n)=>{n.d(s,{R:()=>c,x:()=>o});var r=n(96540);const i={},d=r.createContext(i);function c(e){const s=r.useContext(d);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),r.createElement(d.Provider,{value:s},e.children)}},34261:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>t,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>a});const r=JSON.parse('{"id":"ecommerce-stacks/shopware/redis/redis/index","title":"Redis","description":"Cache","source":"@site/docs/ecommerce-stacks/shopware/redis/redis/index.md","sourceDirName":"ecommerce-stacks/shopware/redis/redis","slug":"/ecommerce-stacks/shopware/redis/redis/","permalink":"/docs/ecommerce-stacks/shopware/redis/redis/","draft":false,"unlisted":false,"editUrl":"https://github.com/ans-group/ans.co.uk-docs/tree/main/docs/ecommerce-stacks/shopware/redis/redis/index.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_label":"Redis","sidebar_position":1},"sidebar":"documentationSidebar","previous":{"title":"Redis","permalink":"/docs/ecommerce-stacks/shopware/redis/"},"next":{"title":"Varnish","permalink":"/docs/ecommerce-stacks/shopware/varnish/"}}');var i=n(74848),d=n(28453);const c={sidebar_label:"Redis",sidebar_position:1},o="Redis",t={},a=[{value:"Cache",id:"cache",level:2},{value:"Sessions",id:"sessions",level:2},{value:"Redis service",id:"redis-service",level:2}];function h(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,d.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"redis",children:"Redis"})}),"\n",(0,i.jsx)(s.h2,{id:"cache",children:"Cache"}),"\n",(0,i.jsxs)(s.p,{children:["From Shopware 5.3 it is possible to use ",(0,i.jsx)(s.a,{href:"https://redis.io/",children:"Redis"})," as cache adapter. Add the following to ",(0,i.jsx)(s.code,{children:"config.php"}),":"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"'model' => [\n 'redisHost' => '127.0.0.1',\n 'redisPort' => 6379,\n 'redisDbIndex' => 0,\n 'cacheProvider' => 'redis'\n],\n'cache' => [\n 'backend' => 'redis', // e.G auto, apcu, xcache\n 'backendOptions' => [\n 'servers' => [\n [\n 'host' => '127.0.0.1',\n 'port' => 6379,\n 'dbindex' => 0,\n 'redisAuth' => ''\n ],\n ],\n ],\n]\n"})}),"\n",(0,i.jsxs)(s.p,{children:["Be aware, that for ",(0,i.jsx)(s.code,{children:"Zend_Cache::CLEANING_MODE_ALL"})," the cache implementation will issue ",(0,i.jsx)(s.code,{children:"FLUSHDB"})," and therefore clear the current Redis DB index. For that reason, the DB index for the cache should not be used for persistent data."]}),"\n",(0,i.jsx)(s.h2,{id:"sessions",children:"Sessions"}),"\n",(0,i.jsxs)(s.p,{children:["You can use Redis for sessions by adding to the ",(0,i.jsx)(s.code,{children:"config.php"})," file:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"'session' => [\n 'save_handler' => 'redis',\n 'save_path' => \"tcp://127.0.0.1:6379\",\n],\n\n'backendsession' => [\n 'save_handler' => 'redis',\n 'save_path' => \"tcp://127.0.0.1:6379\",\n],\n"})}),"\n",(0,i.jsx)(s.p,{children:"You may need to change the IP address and you can change the port to run backend sessions and frontend sessions on different instances."}),"\n",(0,i.jsx)(s.h2,{id:"redis-service",children:"Redis service"}),"\n",(0,i.jsxs)(s.p,{children:["You can find more information on the Redis service ",(0,i.jsx)(s.a,{href:"../../../../operating-systems/linux/redis/",children:"here"}),"."]})]})}function l(e={}){const{wrapper:s}={...(0,d.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.