Laravel Valkey is a fully managed, Redis-compatible cache for your application. Laravel Valkey comes in sizes starting at 250MB. It performs better and costs less than industry averages, and it can scale automatically. Flex sizes can also scale to zero when idle. All Laravel Valkey instances support up to 10,000 concurrent connections.Caches can store application data, back queue systems, and manage sessions. You can also access a cache directly through the Redis API. Laravel applications can use Laravel’s cache, queues, sessions, and Redis API integrations.
To attach a Laravel Valkey cache to an environment, click Cache on your environment’s canvas. Laravel Cloud prompts you to select the cache you would like to attach to the environment or to create a new cache. If you create a new cache, select Laravel Valkey as the cache type.
After you attach the cache to an environment, redeploy the environment for the changes to take effect.Visit the pricing docs for information on cache sizes and limits on message sizes.
When a cache is attached to an environment, Laravel Cloud automatically injects connection environment variables, including REDIS_HOST and REDIS_PASSWORD. Laravel applications can also use CACHE_STORE with the Cache facade. You may view these variables in your environment’s General Settings.
To connect to Laravel Valkey from your local machine, navigate to Organization > Resources > Caches, click your cache, and click View credentials at the top of the page. From your environment’s canvas, you can also open the cache’s … menu and select View details to reach this page.
The cache credentials modal shows the credentials you need to connect to your cache. It also shows a command you can run to connect to your Valkey cache server.
You may connect using a client that supports TLS and SNI. Some cache management tools are incompatible with this connection process.
You may edit and resize a Laravel Valkey cache from your organization’s Resources page. Navigate to the Caches tab and click the … icon for the cache you would like to edit or resize. Then, click Edit settings.
If your project no longer needs a cache, you can detach it from your application canvas.
Detaching a cache does not delete it. Because many applications can share a cache, you can only detach a cache from your application. You can’t delete it from there.Laravel Cloud bills caches for their availability, regardless of whether an application is using them. To permanently delete a cache, visit your organization’s Resources page.
You may delete a Laravel Valkey cache from your organization’s Resources page. Navigate to the Caches tab and click the … icon for the cache you would like to delete. Then, click Delete cache.
When your cache reaches its memory limit, an eviction policy determines which data Valkey removes to make room for new entries. With Laravel Valkey, you can configure this policy based on your application’s specific traffic patterns.By default, we recommend using the allkeys-lru policy for most general-purpose use cases. It keeps your most recently accessed data in memory and evicts the items that haven’t been touched in a while. That keeps the hit rate high for active users.If your workload has specific requirements (such as prioritizing keys with expiration timers), you can choose from the following Valkey-native policies:
allkeys-lfu: Evicts the least frequently used keys. Best for workloads where specific “hot” keys stay relevant for long periods.
allkeys-random: Randomly removes keys to make space. Useful for testing or when all data has equal value.
volatile-lru: Evicts the least recently used keys only among those with a TTL set. Best when you want to protect “permanent” keys from eviction.
volatile-lfu: Evicts the least frequently used keys only among those with a TTL set. Best for frequency-based scaling with specific transient data.
volatile-random: Randomly removes keys that have a TTL set. Rarely needed. Minimizes overhead but is unpredictable.
volatile-ttl: Removes keys with a TTL set, starting with the shortest remaining life. Best when you want the “soonest to expire” to go first.
noeviction: Returns an error when the memory limit is reached.
Laravel Valkey Flex sizes can scale to zero. A Flex cache sleeps when it’s idle, and you aren’t billed for compute while it sleeps. Before the cache sleeps, Laravel Cloud snapshots its contents to disk, then restores them transparently when the cache wakes, so you keep your data.Scale-to-Zero is enabled by default on Flex caches. If you need a cache to stay awake, disable Scale-to-Zero in the cache’s settings. Larger Pro sizes are always-on and do not scale to zero. Pairing a Flex cache that scales to zero with application compute that scales to zero helps minimize costs on development environments and side projects.
Laravel Valkey has hard limits on usage, such as commands per second and message size. When your cache reaches these limits, its performance may degrade or it may stop accepting new requests.Laravel Cloud offers automatic upsizing for Laravel Valkey, so your cache keeps running smoothly as your usage grows. You can enable or disable this feature at any time.
Provisioning and configuration. When you create or update a cache with automatic upsizing enabled, Laravel Cloud provisions the cache and configures its upsizing settings.
Monitoring. Laravel Cloud continuously monitors your cache’s usage. If your cache approaches its usage limits, Laravel Cloud prepares to upsize it.
Notifications. When your cache reaches a threshold or an upsize starts, Laravel Cloud sends you an alert notification.
Upsizing without downtime. Laravel Cloud moves your cache to the next available size in the background, with no downtime for your application.
With automatic upsizing enabled, your cache scales automatically up to your current plan’s maximum capacity. On the Growth plan, you may contact support to raise this limit. On the Starter plan, upgrade to Growth to use larger cache sizes.
After an upsize, Laravel Cloud adjusts your billing to reflect the new cache size. See the pricing documentation for details.
To view metrics such as storage usage, throughput, and cache hit and miss ratios for Laravel Valkey, navigate to Organization > Resources > Caches, click your cache, and review the Metrics section. Use the time range selector to adjust the period shown. You can also select … > View metrics on the cache card to jump directly to this section.
Your cache may restart as part of normal operations, such as feature updates and security updates. A restart may cause transient errors with some PHP clients, such as Error while reading line from the server or read error on connection to tls.These errors are expected because a TCP connection cannot survive a server restart.To handle them, we recommend that your application:
Catches transient errors.
Automatically reconnects to the cache through a new, healthy connection.
For the safety of your cache, we enforce a maximum size for messages sent to your cache. The Laravel Valkey pricing table lists the limit for each cache size. If a client sends a message that exceeds this limit, we treat it as a protocol violation and immediately force-close the TCP connection.Because the server drops the connection, your client won’t receive a standard error response. Instead, it registers a low-level network error, such as:
Error while reading line from the server (PHP)
Error: read ECONNRESET (Node.js)
Connection reset by peer (Python and Java)
To fix the error, reduce the message size or upgrade your cache size.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Laravel Cloud","colors":{"primary":"#0057FF","light":"#71A8FF","dark":"#0057FF"},"logo":{"light":"https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/logo/laravel-logo-light.png?fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=f508d8e9c4e3c842e83d055cc376daa1","dark":"https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/logo/laravel-logo-dark.png?fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=fcfe00a4914f5e3ad791b606c3e75795","href":"https://cloud.laravel.com/"},"favicon":"https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/favicons/favicon-dark.png?fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=edd5608e08efe6ae6a4ca1b44232d2af","navbar":{"links":[],"primary":{"type":"button","label":"Get Started","href":"https://cloud.laravel.com"}},"footer":{"socials":{"x":"https://x.com/laravel","github":"https://github.com/laravel","discord":"https://discord.gg/laravel","youtube":"https://www.youtube.com/laravelphp"}},"seo":{"metatags":{"robots":"noindex"}},"integrations":{"fathom":{"siteId":"KZRWMQWT"}},"banner":{"content":"Deploy Next and Nuxt frontends alongside your Laravel apps, all from one unified platform. \u003ca href='https://laravel.com/blog/deploy-nextjs-and-nuxt-apps-on-laravel-cloud'>Learn more →\u003c/a>","dismissible":true},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cloud","hasAudioNarration":false,"actualSubdomain":"cloud","customDomains":["cloud.laravel.com"],"gitSource":{"type":"github","owner":"laravel","repo":"cloud-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae8a8476bec035f345a037a","collectionId":"fd9a4345-b3eb-4dc3-ba38-99dcf67f5dbb","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae8a8476bec035f345a037a"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae8a8476bec035f345a037a","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"API","count":130},{"language":"default","tag":"Endpoints","count":126},{"language":"default","tag":"Documentation","count":60},{"language":"default","tag":"Knowledge Base","count":21},{"language":"default","tag":"Basics","count":17},{"language":"default","tag":"Environments","count":15},{"language":"default","tag":"Instances","count":14},{"language":"default","tag":"Private Cloud","count":10},{"language":"default","tag":"Caches","count":9},{"language":"default","tag":"Deploy guides","count":8}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false,"deflection":{"enabled":false,"showHelpButton":false}},"basePath":"/cloud/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"/* latin-ext */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0She1YmV.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0SZe1Q.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/cloud/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nbody{font-family:\"Instrument Sans\";font-weight:400}h1,h2,h3,h4{font-family:\"Instrument Sans\"!important;letter-spacing:-.025em!important}code,pre{font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace}.font-semibold,b,h1,h2,h3,h4,strong{font-weight:500!important}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500!important;color:rgb(var(--primary))!important}.dark .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:rgb(var(--primary-light))!important}.table-auto{table-layout:auto}table.table-fixed{table-layout:fixed!important}table{table-layout:auto!important;display:table}th{text-align:left}td>p.icon{margin:0}.pr-16{padding-right:4em}.max-w-none{max-width:none!important}.align-top{vertical-align:top}.italic{font-style:italic}.pr-20{padding-right:5rem}.max-h-50vh{max-height:50vh}.select-arrow{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-size:1.5em 1.5em;background-position:right .5rem center;background-repeat:no-repeat}#banner a{color:rgb(var(--white))!important;white-space:nowrap}#banner>div>p{white-space:normal;padding-top:.125rem;padding-bottom:.125rem;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:3;-webkit-line-clamp:3}#banner:has(>button){padding-right:2.5rem}@media screen and (min-width:768px){#banner{height:auto}#banner:has(>button){padding-left:2.5rem}}#topbar-cta-button a>span:first-child{background-color:rgb(22 25 30)}.dark #topbar-cta-button a>span:first-child{background-color:rgb(255 255 255)}.dark #topbar-cta-button a,.dark #topbar-cta-button a *{color:rgb(22 25 30)!important}"}],"page":{"pagePath":"resources/caches/valkey","slug":"/resources/caches/valkey","pageMetadata":{"title":"Laravel Valkey","sidebarTitle":"Valkey","description":"Fully managed, Redis-compatible cache for your application.","href":"/resources/caches/valkey"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Fully managed, Redis-compatible cache for your application.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Frame,Heading,OptimizedImage,Warning}=_components;if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`introduction`,children:`Introduction`}),`\n`,_jsxs(_components.p,{children:[`Laravel Valkey is a fully managed, Redis-compatible cache for your application. Laravel Valkey comes in sizes starting at 250MB. It performs better and costs less than industry averages, and it can scale automatically. Flex sizes can also `,_jsx(_components.a,{href:`#scale-to-zero`,children:`scale to zero`}),` when idle. All Laravel Valkey instances support up to 10,000 concurrent connections.`]}),`\n`,_jsxs(_components.p,{children:[`Caches can store application data, back queue systems, and manage sessions. You can also access a cache directly through the Redis API. Laravel applications can use Laravel’s `,_jsx(_components.a,{href:`https://laravel.com/docs/cache`,children:`cache`}),`, `,_jsx(_components.a,{href:`https://laravel.com/docs/queues`,children:`queues`}),`, `,_jsx(_components.a,{href:`https://laravel.com/docs/session`,children:`sessions`}),`, and `,_jsx(_components.a,{href:`https://laravel.com/docs/redis`,children:`Redis API`}),` integrations.`]}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-laravel-valkey-cache`,children:`Creating a Laravel Valkey cache`}),`\n`,_jsxs(_components.p,{children:[`To attach a Laravel Valkey cache to an environment, click `,_jsx(_components.strong,{children:`Cache`}),` on your environment’s canvas. Laravel Cloud prompts you to select the cache you would like to attach to the environment or to create a new cache. If you create a new cache, select `,_jsx(_components.strong,{children:`Laravel Valkey`}),` as the cache type.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=a24d9cf25cd6b3d1f7beab87718abdee`,\"data-og-width\":`2380`,width:`2380`,\"data-og-height\":`1254`,height:`1254`,\"data-path\":`images/add-valkey-cache.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=280\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=67d8f613c935af55c43e14462c590265 280w, https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=560\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=7c2b751384a0e3fb64308ff846e9d886 560w, https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=840\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=205f2db98b7fbc4c837ae63805820f53 840w, https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=1100\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=cea347e436c30414183b800455cfcc54 1100w, https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=1650\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=a18a2c4e00db943527adb9efcc06dc43 1650w, https://mintcdn.com/cloud/83RcCEaWR6PzmMFO/images/add-valkey-cache.png?w=2500\u0026fit=max\u0026auto=format\u0026n=83RcCEaWR6PzmMFO\u0026q=85\u0026s=22b0d530e15ba71bf67a83cf64cb66e3 2500w`})}),`\n`,_jsx(_components.p,{children:`After you attach the cache to an environment, redeploy the environment for the changes to take effect.`}),`\n`,_jsxs(_components.p,{children:[`Visit the `,_jsx(_components.a,{href:`/pricing#laravel-valkey`,children:`pricing`}),` docs for information on cache sizes and limits on message sizes.`]}),`\n`,_jsx(Heading,{level:`2`,id:`connecting-to-laravel-valkey`,children:`Connecting to Laravel Valkey`}),`\n`,_jsx(Heading,{level:`3`,id:`from-your-application`,children:`From your application`}),`\n`,_jsxs(_components.p,{children:[`When a cache is attached to an environment, Laravel Cloud automatically injects connection environment variables, including `,_jsx(_components.code,{children:`REDIS_HOST`}),` and `,_jsx(_components.code,{children:`REDIS_PASSWORD`}),`. Laravel applications can also use `,_jsx(_components.code,{children:`CACHE_STORE`}),` with the `,_jsx(_components.code,{children:`Cache`}),` facade. You may view these variables in your environment’s General Settings.`]}),`\n`,_jsx(Heading,{level:`3`,id:`from-your-local-machine`,children:`From your local machine`}),`\n`,_jsxs(_components.p,{children:[`To connect to Laravel Valkey from your local machine, navigate to `,_jsx(_components.strong,{children:`Organization > Resources > Caches`}),`, click your cache, and click `,_jsx(_components.strong,{children:`View credentials`}),` at the top of the page. From your environment’s canvas, you can also open the cache’s `,_jsx(_components.strong,{children:`…`}),` menu and select `,_jsx(_components.strong,{children:`View details`}),` to reach this page.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=8efd09f9a1e64a2ca9343246cbb4c05c`,\"data-og-width\":`740`,width:`740`,\"data-og-height\":`570`,height:`570`,\"data-path\":`images/find_valkey_credentials.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=280\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=1bee46fc96b47bff9195893f17a9e167 280w, https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=560\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=59f044ce4a46e1f281eb62fc679e23af 560w, https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=840\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=6f1ff6b68af3699c43a7f56e21d1e474 840w, https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=1100\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=35f084ba15eb6c44729586aa2d9de37f 1100w, https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=1650\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=c3ceeddd31899ae445ee5a50eab11f21 1650w, https://mintcdn.com/cloud/52IA0MrcdN0kBtGa/images/find_valkey_credentials.png?w=2500\u0026fit=max\u0026auto=format\u0026n=52IA0MrcdN0kBtGa\u0026q=85\u0026s=5e8045b3179d4b5a2b9f1783214d6100 2500w`})}),`\n`,_jsx(_components.p,{children:`The cache credentials modal shows the credentials you need to connect to your cache. It also shows a command you can run to connect to your Valkey cache server.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`You may connect using a client that supports TLS and SNI. Some cache management tools are incompatible with this connection process.`})}),`\n`,_jsx(Heading,{level:`2`,id:`editing-and-resizing-your-cache`,children:`Editing and resizing your cache`}),`\n`,_jsxs(_components.p,{children:[`You may edit and resize a Laravel Valkey cache from your organization’s `,_jsx(_components.strong,{children:`Resources`}),` page. Navigate to the `,_jsx(_components.strong,{children:`Caches`}),` tab and click the `,_jsx(_components.strong,{children:`…`}),` icon for the cache you would like to edit or resize. Then, click `,_jsx(_components.strong,{children:`Edit settings`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`detaching-and-deleting-your-cache`,children:`Detaching and deleting your cache`}),`\n`,_jsx(_components.p,{children:`If your project no longer needs a cache, you can detach it from your application canvas.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=e2e7f118c6aa2c5b717d4cc4bb0991ea`,\"data-og-width\":`962`,width:`962`,\"data-og-height\":`664`,height:`664`,\"data-path\":`images/detach_valkey_cache.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=280\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=c8ce473e2c0baa2cf3c3c836bce75404 280w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=560\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=4ee556daf9bd51d8349c968db69dc29e 560w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=840\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=e17f0ca71f1438455d49366af19e5e35 840w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=1100\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=9684db2367cd378be7505ef95a362ead 1100w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=1650\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=cecef7b87349cd8312623d17381e8b9c 1650w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/detach_valkey_cache.png?w=2500\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=0b6b72576ca153e046fe6fc4dc4f614a 2500w`})}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Detaching a cache does not delete it.`}),` Because many applications can share a cache, you can only detach a cache from your application. You can’t delete it from there.`]}),_jsxs(_components.p,{children:[`Laravel Cloud bills caches for their availability, regardless of whether an application is using them. To permanently delete a cache, visit your `,_jsx(_components.a,{href:`https://cloud.laravel.com/to/org/resources/caches`,children:`organization’s Resources page`}),`.`]})]}),`\n`,_jsxs(_components.p,{children:[`You may delete a Laravel Valkey cache from your `,_jsx(_components.a,{href:`https://cloud.laravel.com/to/org/resources/caches`,children:`organization’s Resources page`}),`. Navigate to the `,_jsx(_components.strong,{children:`Caches`}),` tab and click the `,_jsx(_components.strong,{children:`…`}),` icon for the cache you would like to delete. Then, click `,_jsx(_components.strong,{children:`Delete cache`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`picking-an-eviction-policy`,children:`Picking an eviction policy`}),`\n`,_jsx(_components.p,{children:`When your cache reaches its memory limit, an eviction policy determines which data Valkey removes to make room for new entries. With Laravel Valkey, you can configure this policy based on your application’s specific traffic patterns.`}),`\n`,_jsxs(_components.p,{children:[`By default, we recommend using the `,_jsx(_components.code,{children:`allkeys-lru`}),` policy for most general-purpose use cases. It keeps your most recently accessed data in memory and evicts the items that haven’t been touched in a while. That keeps the hit rate high for active users.`]}),`\n`,_jsx(_components.p,{children:`If your workload has specific requirements (such as prioritizing keys with expiration timers), you can choose from the following Valkey-native policies:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`allkeys-lfu`}),`: Evicts the least frequently used keys. Best for workloads where specific “hot” keys stay relevant for long periods.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`allkeys-random`}),`: Randomly removes keys to make space. Useful for testing or when all data has equal value.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`volatile-lru`}),`: Evicts the least recently used keys only among those with a TTL set. Best when you want to protect “permanent” keys from eviction.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`volatile-lfu`}),`: Evicts the least frequently used keys only among those with a TTL set. Best for frequency-based scaling with specific transient data.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`volatile-random`}),`: Randomly removes keys that have a TTL set. Rarely needed. Minimizes overhead but is unpredictable.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`volatile-ttl`}),`: Removes keys with a TTL set, starting with the shortest remaining life. Best when you want the “soonest to expire” to go first.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`noeviction`}),`: Returns an error when the memory limit is reached.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`scale-to-zero`,children:`Scale-to-Zero`}),`\n`,_jsx(_components.p,{children:`Laravel Valkey Flex sizes can scale to zero. A Flex cache sleeps when it’s idle, and you aren’t billed for compute while it sleeps. Before the cache sleeps, Laravel Cloud snapshots its contents to disk, then restores them transparently when the cache wakes, so you keep your data.`}),`\n`,_jsxs(_components.p,{children:[`Scale-to-Zero is enabled by default on Flex caches. If you need a cache to stay awake, disable Scale-to-Zero in the cache’s settings. Larger Pro sizes are always-on and do not scale to zero. Pairing a Flex cache that scales to zero with `,_jsx(_components.a,{href:`/compute#scale-to-zero`,children:`application compute that scales to zero`}),` helps minimize costs on development environments and side projects.`]}),`\n`,_jsx(Heading,{level:`2`,id:`automatic-upsizing`,children:`Automatic upsizing`}),`\n`,_jsx(_components.p,{children:`Laravel Valkey has hard limits on usage, such as commands per second and message size. When your cache reaches these limits, its performance may degrade or it may stop accepting new requests.`}),`\n`,_jsx(_components.p,{children:`Laravel Cloud offers automatic upsizing for Laravel Valkey, so your cache keeps running smoothly as your usage grows. You can enable or disable this feature at any time.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=88c798740ed91037616cdb8839c0ce70`,\"data-og-width\":`1726`,width:`1726`,\"data-og-height\":`376`,height:`376`,\"data-path\":`images/valkey_auto-upgrade.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=280\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=cf5e0ce7f4eefa7577473bbdc87b632f 280w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=560\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=eb9ee2d0b1f7d8c4ab98c742684d5884 560w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=840\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=435eb0da61f364425b563661236c16b8 840w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=1100\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=632fe996bcf1523433c2046b67c5820a 1100w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=1650\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=5c5f9a708ce21af56dd701cc8cc24572 1650w, https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/images/valkey_auto-upgrade.png?w=2500\u0026fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=6c64a43b92f0dfe33df529e3c8e7349d 2500w`})}),`\n`,_jsx(Heading,{level:`3`,id:`how-automatic-upsizing-works`,children:`How automatic upsizing works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Provisioning and configuration.`}),` When you create or update a cache with automatic upsizing enabled, Laravel Cloud provisions the cache and configures its upsizing settings.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Monitoring.`}),` Laravel Cloud continuously monitors your cache’s usage. If your cache approaches its usage limits, Laravel Cloud prepares to upsize it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Notifications.`}),` When your cache reaches a threshold or an upsize starts, Laravel Cloud sends you an alert `,_jsx(_components.a,{href:`/notifications`,children:`notification`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Upsizing without downtime.`}),` Laravel Cloud moves your cache to the next available size in the background, with no downtime for your application.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`With automatic upsizing enabled, your cache scales automatically `,_jsx(_components.strong,{children:`up to your current plan’s maximum capacity`}),`. On the Growth plan, you may `,_jsx(_components.a,{href:`/support`,children:`contact support`}),` to `,_jsx(_components.a,{href:`/pricing#raising-plan-limits`,children:`raise this limit`}),`. On the Starter plan, upgrade to Growth to use larger cache sizes.`]})}),`\n`,_jsxs(_components.p,{children:[`After an upsize, Laravel Cloud adjusts your billing to reflect the new cache size. See the `,_jsx(_components.a,{href:`/pricing#laravel-valkey`,children:`pricing`}),` documentation for details.`]}),`\n`,_jsx(Heading,{level:`2`,id:`monitoring-cache-metrics`,children:`Monitoring cache metrics`}),`\n`,_jsxs(_components.p,{children:[`To view metrics such as storage usage, throughput, and cache hit and miss ratios for Laravel Valkey, navigate to `,_jsx(_components.strong,{children:`Organization > Resources > Caches`}),`, click your cache, and review the `,_jsx(_components.strong,{children:`Metrics`}),` section. Use the time range selector to adjust the period shown. You can also select `,_jsx(_components.strong,{children:`… > View metrics`}),` on the cache card to jump directly to this section.`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`handling-transient-connection-errors`,children:`Handling transient connection errors`}),`\n`,_jsxs(_components.p,{children:[`Your cache may restart as part of normal operations, such as feature updates and security updates. A restart may cause transient errors with some PHP clients, such as `,_jsx(_components.code,{children:`Error while reading line from the server`}),` or `,_jsx(_components.code,{children:`read error on connection to tls`}),`.`]}),`\n`,_jsx(_components.p,{children:`These errors are expected because a TCP connection cannot survive a server restart.`}),`\n`,_jsx(_components.p,{children:`To handle them, we recommend that your application:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Catches transient errors.`}),`\n`,_jsx(_components.li,{children:`Automatically reconnects to the cache through a new, healthy connection.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`We recommend following the `,_jsx(_components.a,{href:`https://laravel.com/docs/13.x/redis#retry-and-backoff-configuration`,children:`retry and backoff best practices`}),` in the Laravel documentation.`]}),`\n`,_jsx(Heading,{level:`3`,id:`connection-force-closed`,children:`Connection force-closed`}),`\n`,_jsxs(_components.p,{children:[`For the safety of your cache, we enforce a maximum size for messages sent to your cache. The `,_jsx(_components.a,{href:`/pricing#laravel-valkey`,children:`Laravel Valkey pricing table`}),` lists the limit for each cache size. If a client sends a message that exceeds this limit, we treat it as a protocol violation and immediately force-close the TCP connection.`]}),`\n`,_jsx(_components.p,{children:`Because the server drops the connection, your client won’t receive a standard error response. Instead, it registers a low-level network error, such as:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Error while reading line from the server`}),` (PHP)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Error: read ECONNRESET`}),` (Node.js)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Connection reset by peer`}),` (Python and Java)`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`To fix the error, reduce the message size or upgrade your cache size.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Laravel Valkey","sidebarTitle":"Valkey","description":"Fully managed, Redis-compatible cache for your application.","href":"/resources/caches/valkey"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Introduction","slug":"introduction","depth":2,"children":[]},{"title":"Creating a Laravel Valkey cache","slug":"creating-a-laravel-valkey-cache","depth":2,"children":[]},{"title":"Connecting to Laravel Valkey","slug":"connecting-to-laravel-valkey","depth":2,"children":[{"title":"From your application","slug":"from-your-application","depth":3,"children":[]},{"title":"From your local machine","slug":"from-your-local-machine","depth":3,"children":[]}]},{"title":"Editing and resizing your cache","slug":"editing-and-resizing-your-cache","depth":2,"children":[]},{"title":"Detaching and deleting your cache","slug":"detaching-and-deleting-your-cache","depth":2,"children":[]},{"title":"Picking an eviction policy","slug":"picking-an-eviction-policy","depth":2,"children":[]},{"title":"Scale-to-Zero","slug":"scale-to-zero","depth":2,"children":[]},{"title":"Automatic upsizing","slug":"automatic-upsizing","depth":2,"children":[{"title":"How automatic upsizing works","slug":"how-automatic-upsizing-works","depth":3,"children":[]}]},{"title":"Monitoring cache metrics","slug":"monitoring-cache-metrics","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"Handling transient connection errors","slug":"handling-transient-connection-errors","depth":3,"children":[]},{"title":"Connection force-closed","slug":"connection-force-closed","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/cloud/docs/_mintlify/custom/cloud/412bdbfbeb58e5da/gtag.js","/cloud/docs/_mintlify/custom/cloud/1a6e9e638535d772/plain.js","/cloud/docs/_mintlify/custom/cloud/f2ef70ddf7841ac3/rudderstack.js","/cloud/docs/_mintlify/custom/cloud/d55d837bfb92372f/scripts/fetch-ips.js"],"subdomain":"cloud","siteName":"Laravel Cloud","title":"Laravel Valkey - Laravel Cloud","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T13:18:09.319Z","originalFileLocation":"resources/caches/valkey.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Fully managed, Redis-compatible cache for your application.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Laravel Cloud\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"noindex\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Laravel Valkey - Laravel Cloud\">\u003cmeta data-mint-head property=\"og:description\" content=\"Fully managed, Redis-compatible cache for your application.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Laravel Cloud\">\u003cmeta data-mint-head property=\"og:url\" content=\"/cloud/docs/resources/caches/valkey\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cloud.mintlify.app/_mintlify/api/og/v2?division=Caches\u0026amp;title=Laravel+Valkey\u0026amp;description=Fully+managed%2C+Redis-compatible+cache+for+your+application.\u0026amp;theme=8d4b254afde5db5ac1120ea2\u0026amp;signature=c679fe351ddf4445775650619fd921a83d11e487d43c520e5ba8b95586e5d0f8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Laravel Valkey - Laravel Cloud\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Fully managed, Redis-compatible cache for your application.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cloud.mintlify.app/_mintlify/api/og/v2?division=Caches\u0026amp;title=Laravel+Valkey\u0026amp;description=Fully+managed%2C+Redis-compatible+cache+for+your+application.\u0026amp;theme=8d4b254afde5db5ac1120ea2\u0026amp;signature=c679fe351ddf4445775650619fd921a83d11e487d43c520e5ba8b95586e5d0f8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/cloud/docs/mintlify-assets/_mintlify/favicons/cloud/CwnEEs8UQ8WD3Jou/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Laravel Cloud\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0057FF\">\u003clink data-mint-head rel=\"canonical\" href=\"/cloud/docs/resources/caches/valkey\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/cloud/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cloud/docs/resources/caches/valkey.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://cloud.laravel.com/#organization\",\"name\":\"Laravel Cloud\",\"url\":\"https://cloud.laravel.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cloud/MkfTsQSKGENWqY-2/logo/laravel-logo-light.png?fit=max\u0026auto=format\u0026n=MkfTsQSKGENWqY-2\u0026q=85\u0026s=f508d8e9c4e3c842e83d055cc376daa1\"}},{\"@type\":\"WebSite\",\"@id\":\"/cloud/docs#website\",\"name\":\"Laravel Cloud\",\"url\":\"/cloud/docs\",\"publisher\":{\"@id\":\"https://cloud.laravel.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"/cloud/docs/resources/caches/valkey#webpage\",\"url\":\"/cloud/docs/resources/caches/valkey\",\"name\":\"Laravel Valkey\",\"description\":\"Fully managed, Redis-compatible cache for your application.\",\"dateModified\":\"2026-10-27T13:18:09.319Z\",\"isPartOf\":{\"@id\":\"/cloud/docs#website\"},\"breadcrumb\":{\"@id\":\"/cloud/docs/resources/caches/valkey#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"/cloud/docs/resources/caches/valkey#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Resources\",\"item\":\"/cloud/docs/resources/databases/laravel-mysql\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Laravel Valkey\",\"item\":\"/cloud/docs/resources/caches/valkey\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"/cloud/docs/resources/caches/valkey#article\",\"headline\":\"Laravel Valkey\",\"name\":\"Laravel Valkey\",\"description\":\"Fully managed, Redis-compatible cache for your application.\",\"url\":\"/cloud/docs/resources/caches/valkey\",\"mainEntityOfPage\":{\"@id\":\"/cloud/docs/resources/caches/valkey#webpage\"},\"dateModified\":\"2026-10-27T13:18:09.319Z\",\"publisher\":{\"@id\":\"https://cloud.laravel.com/#organization\"},\"isPartOf\":{\"@id\":\"/cloud/docs#website\"}}]}\u003c/script>","siteName":"Laravel Cloud","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Welcome to Laravel Cloud","sidebarTitle":"Introduction","href":"/intro"},{"title":"Quickstart","sidebarTitle":"Quickstart","mode":"wide","href":"/quickstart"},{"title":"Runtimes","sidebarTitle":"Runtimes","href":"/runtimes"}]},{"group":"Deploy guides","pages":[{"title":"Laravel deploy guide","sidebarTitle":"Laravel","href":"/deploy-guides/laravel"},{"title":"Next.js deploy guide","sidebarTitle":"Next.js","href":"/deploy-guides/nextjs"},{"title":"Nuxt deploy guide","sidebarTitle":"Nuxt","href":"/deploy-guides/nuxt"},{"title":"Node.js deploy guide","sidebarTitle":"Node.js","href":"/deploy-guides/nodejs"},{"title":"Go deploy guide","sidebarTitle":"Go","href":"/deploy-guides/go"},{"title":"Python deploy guide","sidebarTitle":"Python","href":"/deploy-guides/python"},{"title":"Ruby and Rails deploy guide","sidebarTitle":"Ruby and Rails","href":"/deploy-guides/ruby"},{"title":"Rust deploy guide","sidebarTitle":"Rust","href":"/deploy-guides/rust"}]},{"group":"Basics","pages":[{"title":"Applications","sidebarTitle":"Applications","href":"/applications"},{"title":"Environments","sidebarTitle":"Environments","href":"/environments"},{"title":"Preview Environments","sidebarTitle":"Preview Environments","href":"/preview-environments"},{"title":"Secrets","sidebarTitle":"Secrets","href":"/secrets"},{"title":"Domains","sidebarTitle":"Domains","href":"/domains"},{"title":"Compute","sidebarTitle":"Compute","href":"/compute"},{"title":"Managed Queues","sidebarTitle":"Managed Queues","href":"/queues"},{"title":"Workers","sidebarTitle":"Workers","href":"/workers"},{"title":"Scheduled tasks","sidebarTitle":"Scheduled tasks","href":"/scheduled-tasks"},{"title":"Deployments","sidebarTitle":"Deployments","href":"/deployments"},{"title":"Health checks","sidebarTitle":"Health checks","href":"/health-checks"},{"title":"Source control","sidebarTitle":"Source control","href":"/source-control"},{"title":"Monorepos","sidebarTitle":"Monorepos","href":"/monorepos"},{"title":"Laravel Cloud Network","sidebarTitle":"Network","href":"/network"},{"title":"Organizations","sidebarTitle":"Organizations","href":"/organizations"},{"title":"Roles and permissions","sidebarTitle":"Roles and permissions","href":"/rbac"},{"title":"Single sign-on","sidebarTitle":"Single sign-on","href":"/sso"}]},{"group":"Resources","pages":[{"group":"Databases","pages":[{"title":"Laravel MySQL","sidebarTitle":"MySQL","href":"/resources/databases/laravel-mysql"},{"title":"Serverless Postgres","sidebarTitle":"Postgres","description":"Fully managed, autoscaling Serverless Postgres database.","href":"/resources/databases/postgres"}]},{"group":"Caches","pages":[{"title":"Laravel Valkey","sidebarTitle":"Valkey","href":"/resources/caches/valkey"},{"title":"Redis by Upstash (deprecated)","sidebarTitle":"Redis","description":"Redis by Upstash is deprecated and isn’t available for new applications. New applications should use Laravel Valkey.","href":"/resources/caches/redis"}]},{"title":"Laravel Object Storage","sidebarTitle":"Object Storage","href":"/resources/object-storage"},{"group":"WebSockets","pages":[{"title":"Laravel Cloud WebSockets","sidebarTitle":"WebSockets","href":"/resources/websockets"},{"title":"Connecting with Pusher SDKs","sidebarTitle":"Pusher SDKs","href":"/resources/websockets/pusher"}]},{"title":"Email","sidebarTitle":"Email","href":"/resources/email"}]},{"group":"Private Cloud","pages":[{"title":"Private Cloud","sidebarTitle":"Overview","href":"/private-cloud"},{"title":"Dedicated edge network","sidebarTitle":"Edge network","href":"/private-cloud/edge-network"},{"title":"Private networking","href":"/private-cloud/private-networking"},{"title":"Internal networking","href":"/private-cloud/internal-networking"},{"title":"IAM roles","sidebarTitle":"IAM roles","href":"/private-cloud/iam-roles"},{"title":"Build configuration","href":"/private-cloud/build-configuration"},{"title":"RDS","sidebarTitle":"RDS","href":"/private-cloud/rds"},{"title":"ElastiCache","sidebarTitle":"ElastiCache","href":"/private-cloud/elasticache"},{"title":"Self-hosted GitLab","href":"/private-cloud/self-hosted-gitlab"},{"title":"Data transfer","href":"/private-cloud/data-transfer"}]},{"group":"Services","pages":[{"group":"Log Drains","pages":[{"title":"Log drains","sidebarTitle":"Overview","href":"/services/log-drains/overview"},{"title":"Log Drains Pricing","sidebarTitle":"Pricing","href":"/services/log-drains/pricing"}]}]},{"group":"Monitoring","pages":[{"title":"Requests","sidebarTitle":"Requests","href":"/requests"},{"title":"Logs","sidebarTitle":"Logs","href":"/logs"},{"title":"Usage","sidebarTitle":"Usage","href":"/usage"},{"title":"Notifications","sidebarTitle":"Notifications","href":"/notifications"}]},{"group":"Billing","pages":[{"title":"Free trial","sidebarTitle":"Free trial","href":"/free-trial"},{"sidebarTitle":"Plans and pricing","title":"Plans and pricing","href":"/pricing"},{"sidebarTitle":"Taxes","title":"Taxes","href":"/taxes"},{"sidebarTitle":"Spending limits","title":"Spending limits","href":"/spending-limits"}]},{"group":"Other","pages":[{"title":"Support","mode":"wide","href":"/support"},{"title":"Changelog","sidebarTitle":"Changelog","href":"/changelog"},{"title":"Compliance \u0026 Security","mode":"wide","href":"/compliance"},{"title":"Report abuse","sidebarTitle":"Abuse","href":"/abuse"}]}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/knowledge-base/intro"}]},{"tab":"API","icon":"square-terminal","pages":[{"title":"API","href":"/api/introduction"}]}]},"basePath":"","title":"Laravel Valkey - Laravel Cloud","buildId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","deploymentId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","dynamics":["10e4515597","07c022d89b","a74be98ba7"],"chunks":["BannerMarkdown-CGuHEvQW.js","dist-B66mVNPp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BcghKhHb.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","Frame-Bj1PpgeO.js","DynamicMarkdown-Bas9A7wq.js","zoom-image-lightbox-B-WKhCOL.js","lightbox-handle-r17bVUz3.js"]}