Caching in GitHub Actions - Namespace Documentation
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Assistant
Responses are generated using AI and may contain mistakes.
Cache Volumes are NVMe-backed storage attached to your runner instances that persist data across GitHub Actions runs. They are the primitive that every caching feature in this section builds on: container image pulls, git checkouts, toolchain downloads, action archives, and build-system caches are all applications layered on top of the same volume infrastructure. For the underlying architecture, see Cache Volumes in the storage documentation.
Choosing a caching solution
You have three options to cache your workflow data with Namespace. Pick based on how much workflow change you can tolerate and how predictable you need cache hits to be:
GitHub Actions Cache
Works out of the box with no workflow changes. Best when you want a drop-in solution and the default behavior is good enough.
There is a ramp-up period when starting to use Cache Volumes, where cache hits will be lower until there is enough distribution of your data. The more jobs you run, the better the cache hit ratio will get. Learn more about Cache Volume onboarding.
Using a cache volume
Cache Volumes attach to a runner and expose a persistent directory that survives across runs. Unlike traditional caching solutions that require time-consuming uploads and downloads, Cache Volumes provide instant access to cached data through guaranteed cache locality. Cache Volumes support very high concurrency through automatic forking and scale up to hundreds of GB to match your project needs.
1
Enable caching on your Runner Profile
Open the desired Runner Profile and enable caching. The minimum cache size is 20 GB.
Enabling Cache Volumes turns on caching for the built-in software layers. Each layer has its own sub-toggle in the profile so you can narrow what is cached: Container images, Git checkouts, Toolchains, and Actions.
2
Use the cache in your workflow
The simplest way to start using the cache is to adopt nscloud-cache-action.
The action supports many popular frameworks natively, but can also be used to cache arbitrary files or directories.
- Add the action to your workflow and select which framework you use. You can enable caching for multiple frameworks simultaneously:
- name: Configure Go and Rust cache
uses: namespacelabs/nscloud-cache-action@v1
with:
cache: |
go
rust
For a full list of supported frameworks, check out the action reference. 2. In case native support is not available yet, you can still make your framework work with Cache Volumes. Simply configure a list of paths to retain:
- name: Configure custom cache
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
~/.cache/custom-tool
/opt/shared-libraries
Our support team can help you identify the optimal cache configuration.
3
Skip GitHub's action cache
After enrolling Namespace’s caching, disable GitHub’s builtin action caching. This ensures that you avoid any superfluous network transfers, reducing the setup time of your workflow further.
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.21"
cache: false # Use Namespace caching instead
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "18"
package-manager-cache: false # Use Namespace caching instead
cache: ""
If your jobs run inside a container, you also need to mount the cache volume inside the container. See Running jobs in containers.
What you can cache
The caching features below all use Cache Volumes.
Container Images
Cache container image layers and the often expensive unpacking step, so repeated pulls complete in seconds. See Container Images.
Git Checkouts
Cache a mirror of your git repository to speed up checkouts of large repositories, submodules, and Git LFS objects. See Git Checkouts.
Toolchain Downloads
Cache downloads from setup actions like actions/setup-go, actions/setup-python, and actions/setup-node.
See Toolchains.
Action Downloads
Cache the action archives your job downloads at startup, and use nscloud-cache-action as an actions/cache replacement.
See Actions.
Build System Integrations
Native caching presets for Bazel, Turborepo, Pants, Moonrepo, Gradle, and sccache. See Build System Integrations.
Advanced cache volume management
Namespace cache volumes are separated at multiple levels to ensure security and prevent data leakage between different contexts.
Isolation levels
Workspace isolation: Each workspace maintains completely separate cache volumes. Caches from one workspace cannot be accessed by any other workspace, providing a strong security boundary between different organizational units or projects.Runner Profiles: Different runner profiles use distinct cache volumes, even within the same workspace. This ensures that builds running on different profiles don’t interfere with each other’s cached data by default. Sharing the cache between two profiles is possible.Repository: Each repository using a specific runner profile gets its own separate cache volume. The cache volume will be shared between all jobs running for a Git repository, but remains distinct from other repositories, even when they share the same runner profile configuration. Sharing the cache between two repositories is possible.For scenarios requiring more control over the cache isolation boundary, custom cache tags can be specified.
Sharing a cache volume
By default, Namespace isolates cache volumes. Each runner profile gets its own cache volume, and within a profile each repository gets its own too.Use a custom cache tag to have several jobs, profiles, or repositories reuse one cache. Every job that resolves to the same tag within a workspace attaches to the same cache volume.Append ;overrides.cache-tag={tag} to the profile name. Two different profiles that set the same
tag share one cache volume:
jobs:
build:
runs-on:
- namespace-profile-builds;overrides.cache-tag=my-shared-cache
steps:
- run: pnpm install
tests:
runs-on:
- namespace-profile-e2e-tests;overrides.cache-tag=my-shared-cache
steps:
- run: pnpm run test
namespace-profile-builds and namespace-profile-e2e-tests are separate profiles with their own
machine shapes and features, but both jobs read and write the same my-shared-cache volume. This
also works across repositories: any repository whose jobs set overrides.cache-tag=my-shared-cache
joins the same cache.Every job sharing the tag can also update the cache contents. To let some of them read the cache
without persisting their changes, see Protect caches from updates.
Custom cache identity
For scenarios requiring full control over the cache isolation boundary, you can specify custom cache tags.To specify a custom cache tag when using a profile, append ;overrides.cache-tag=new-tag-value to the profile name:
runs-on: namespace-profile-my-profile;overrides.cache-tag=new-tag-value
Because every job resolving to the same cache tag attaches to the same volume, this is also how you share a cache across profiles or repositories. See Sharing a cache volume.
Protect caches from updates
You can configure Cache Volumes to limit what git branches can perform updates to them.
Restricting the source of cache updates is useful to avoid cache poisoning.
When using this feature, all branches (including pull requests) can benefit from your cache, but only selected branches (e.g. main) may commit changes to it.To specify which branches can update the cache volume, open the cache volume configuration, then
check Show Advanced features, and finally type the branch names.
Any GitHub Actions job belonging to git branches that are not included in the allow-list, will be able to access the Cache Volumes, but their changes to the caches’ content will not be persisted in the end. You may also use an asterisk as a placeholder to match a branch name pattern.
Manage cache access per job
Instead of protecting your cache per branch, you can also select which jobs may write to the cache. This lets you share a cache amongst multiple jobs while some are not allowed to update its contents. Any job without commit rights can still access the cache and can also change contents locally. But any edits that it makes to the cache will be ignored for future runs.
Next steps
For advanced configuration see Runner Labels.
Last modified onSeptember 22, 2026
Ctrl+I
{"docsConfig":{"theme":"almond","$schema":"https://mintlify.com/docs.json","name":"Namespace Documentation","colors":{"primary":"#1C32FF","light":"#6B78FF","dark":"#1C32FF"},"logo":{"light":"https://mintcdn.com/namespace-labs/qOJQ7kaWRgoS8lyv/logo-light.svg?fit=max\\u0026auto=format\\u0026n=qOJQ7kaWRgoS8lyv\\u0026q=85\\u0026s=6827b0c81c335badc1cef13b83383e1d","dark":"https://mintcdn.com/namespace-labs/qOJQ7kaWRgoS8lyv/logo-dark.svg?fit=max\\u0026auto=format\\u0026n=qOJQ7kaWRgoS8lyv\\u0026q=85\\u0026s=63702d83d8fb259023deb79db06aabbb","href":"https://namespace.so"},"favicon":"https://mintcdn.com/namespace-labs/MoefQ379UcpNU680/favicon.svg?fit=max\\u0026auto=format\\u0026n=MoefQ379UcpNU680\\u0026q=85\\u0026s=6f14a088da55e5f41847845796737353","navbar":{"links":\[{"href":"https://namespace.so/changelog","label":"Changelog"},{"href":"https://namespace.so/support","label":"Support"}\],"primary":{"type":"button","label":"Log in","href":"https://cloud.namespace.so"}},"footer":{"socials":{"github":"https://github.com/namespacelabs","linkedin":"https://www.linkedin.com/company/namespacelabs","x":"https://x.com/namespacelabs"}},"icons":{"library":"lucide"},"contextual":{"options":\["copy","view","chatgpt","claude"\],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":true},"navigation":{"global":{"anchors":\[{"anchor":"Changelog","icon":"history","href":"https://namespace.so/changelog"},{"anchor":"Trust Center (SOC2)","icon":"shield-check","href":"https://trust.namespace.so/"},{"anchor":"Status","icon":"activity","href":"https://namespace-status.com/"},{"anchor":"Support","icon":"message-circle","href":"https://namespace.so/support"}\]},"pages":\[\]}},"deployment":{"deploymentMetadataValue":{"subdomain":"namespace-labs","hasAudioNarration":false,"actualSubdomain":"namespace-labs","customDomains":\["namespace.so"\],"gitSource":{"type":"github","owner":"namespacelabs","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ae0862207896b4595e1934b","collectionId":"847aecca-4a0b-40b4-a393-e976cc214b43","liveDeploymentHistoryId":"6ae0862207896b4595e1934b","schemaVersion":"v3"},"entitlements":{"AI\_CHAT":{"status":"ENABLED"},"WEB\_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae0a8f6edbd4c098a94623c","clientVersion":"0.0.3971","searchFilterCounts":\[{"language":"default","tag":"Products","count":377},{"language":"default","tag":"CLI","count":166},{"language":"default","tag":"Command line","count":165},{"language":"default","tag":"Namespace CLI","count":131},{"language":"default","tag":"Documentation","count":104},{"language":"default","tag":"GitHub Actions","count":40},{"language":"default","tag":"Devbox CLI","count":34},{"language":"default","tag":"Integrations","count":33},{"language":"default","tag":"SDK","count":25},{"language":"default","tag":"Namespace SDK","count":23}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/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":"editor-v7-file-tree","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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"editor-agent-model-picker","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":true},"customCss":[{"filePath":"snippets/diagrams/styles.css","content":".ns-diagram{--ns-diagram-background:#ffffff;--ns-diagram-grid:#e5e7ee;--ns-diagram-border:#e5e7ee;--ns-diagram-card:#ffffff;--ns-diagram-neutral-zone:#fafbfc;--ns-diagram-brand-zone-start:rgba(28, 50, 255, 0.04);--ns-diagram-brand-zone-end:rgba(28, 50, 255, 0.07);--ns-diagram-brand-border:#c8ceff;--ns-diagram-heading:#202938;--ns-diagram-muted:#8892a6;--ns-diagram-copy:#4a5468;position:relative;width:100%;margin:2rem 0;padding:clamp(20px,3.5vw,32px);overflow:hidden;color:var(--ns-diagram-heading);background:var(--ns-diagram-background);border:1px solid var(--ns-diagram-border);border-radius:20px;box-shadow:0 1px 0 rgba(32,41,56,.04),0 1px 2px rgba(32,41,56,.06)}.dark .ns-diagram{--ns-diagram-background:#111827;--ns-diagram-grid:#374151;--ns-diagram-border:#374151;--ns-diagram-card:#1f2937;--ns-diagram-neutral-zone:#171f2d;--ns-diagram-brand-zone-start:rgba(107, 120, 255, 0.1);--ns-diagram-brand-zone-end:rgba(107, 120, 255, 0.16);--ns-diagram-brand-border:#4f5fc7;--ns-diagram-heading:#f3f4f6;--ns-diagram-muted:#aeb6c5;--ns-diagram-copy:#cbd5e1}.ns-diagram-grid-background{position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(circle,var(--ns-diagram-grid) 1px,transparent 1px);background-size:16px 16px;opacity:.5;mask-image:linear-gradient(180deg,transparent 0,#000 10%,#000 90%,transparent 100%)}.ns-diagram-content{position:relative}.ns-diagram-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ns-diagram-mark{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;border-radius:8px}.ns-diagram-mark-anthropic{color:#d97757;background:#fcefe8}.ns-diagram-mark-devin{color:#4338ca;background:#eef0ff}.ns-diagram-mark-cursor{color:#111827;background:#eef0f3}.ns-diagram-mark-control{color:#1c32ff;background:#e0e7ff}.ns-diagram-mark-terminal{color:#fff;background:#202938}.ns-diagram-mark-worker{color:#4338ca;background:#eef1ff}.ns-diagram-zone{position:relative;display:flex;flex-direction:column;padding:1.25rem;background:var(--ns-diagram-neutral-zone);border:1px dashed #d2d6e0;border-radius:14px}.dark .ns-diagram-zone{border-color:#4b5563}.ns-diagram-zone-brand{background:linear-gradient(180deg,var(--ns-diagram-brand-zone-start),var(--ns-diagram-brand-zone-end));border:1px solid var(--ns-diagram-brand-border)}.ns-diagram-zone-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem;color:var(--ns-diagram-copy);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase}.ns-diagram-zone-center{display:flex;flex:1;align-items:center}.ns-diagram-zone-center>*{width:100%}.ns-diagram-card{position:relative;display:flex;align-items:center;gap:1rem;min-width:0;padding:1rem 1.25rem;background:var(--ns-diagram-card);border:1px solid var(--ns-diagram-border);border-radius:12px;box-shadow:0 1px 0 rgba(32,41,56,.04),0 1px 2px rgba(32,41,56,.06)}.ns-diagram-card-brand{border-color:var(--ns-diagram-brand-border)}.ns-diagram-card-copy{display:flex;min-width:0;flex-direction:column}.ns-diagram-card-label{color:var(--ns-diagram-heading);font-size:16px;font-weight:600;line-height:1.25;letter-spacing:-.01em}.ns-diagram-card-sublabel{margin-top:.125rem;color:var(--ns-diagram-muted);font-size:12px;line-height:1.35}.ns-managed-layout{display:grid;grid-template-columns:1fr auto 1.05fr;align-items:stretch}.ns-managed-connector{display:flex;width:64px;flex-direction:column;align-items:center;justify-content:center;padding:0 .25rem;color:var(--ns-diagram-muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10.5px}.ns-managed-connector>span{margin-bottom:.375rem}.ns-managed-connector-path{display:flex;width:56px;align-items:center}.ns-managed-connector-line{flex:1;height:1.5px;background:#d2d6e0}.ns-managed-connector-arrow{border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:9px solid #d2d6e0}.ns-mini-connector{display:flex;flex-direction:column;align-items:center;padding:.375rem 0}.ns-mini-connector>div{width:1.5px;height:12px;background:var(--ns-diagram-brand-border)}.ns-mini-connector>span{border-top:7px solid var(--ns-diagram-brand-border);border-right:5px solid transparent;border-left:5px solid transparent}.ns-devin-devboxes,.ns-devin-sessions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.5rem}.ns-devin-mobile-layout{display:none}.ns-devin-connectors,.ns-devin-connectors>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.ns-devin-connectors{gap:1.5rem}.ns-devin-connectors>div{padding:0 1rem}.ns-devin-connector{position:relative;display:flex;min-height:110px;align-items:center;justify-content:center;color:var(--ns-diagram-copy);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;line-height:1.25;text-align:center}.ns-devin-management-connector{min-height:70px;color:#6366f1}.ns-devin-connector-line{position:absolute;top:0;bottom:0;left:50%;width:1.5px;background:#d2d6e0;transform:translateX(-50%)}.ns-devin-management-connector .ns-devin-connector-line,.ns-diagram-connector-dashed .ns-diagram-vertical-line{width:0;background:0 0;border-left:1.5px dashed var(--ns-diagram-brand-border)}.ns-devin-connector>span,.ns-diagram-vertical-connector>span{position:relative;z-index:1;padding:0 .375rem;background:var(--ns-diagram-background)}.ns-control-plane-pill{display:flex;align-items:center;align-self:center;gap:.375rem;margin-bottom:1rem;padding:.375rem .75rem;color:#4338ca;background:#eef1ff;border:1px solid var(--ns-diagram-brand-border);border-radius:999px;font-size:12px;font-weight:500}.ns-diagram-vertical-connector{position:relative;display:flex;align-items:center;justify-content:center;color:var(--ns-diagram-copy);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;line-height:1.25;text-align:center}.ns-diagram-vertical-line{position:absolute;top:0;bottom:0;left:50%;width:1.5px;background:#d2d6e0;transform:translateX(-50%)}.ns-diagram-connector-dashed{color:#6366f1}.ns-diagram-arrow-down{position:absolute;bottom:0;left:50%;border-top:8px solid #d2d6e0;border-right:5px solid transparent;border-left:5px solid transparent;transform:translateX(-50%)}.ns-devin-management-connector .ns-diagram-arrow-down,.ns-diagram-connector-dashed .ns-diagram-arrow-down{border-top-color:var(--ns-diagram-brand-border)}.ns-bazel-connector-inset{padding:0 1rem}.ns-bazel-workers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}@media (max-width:767px){.ns-managed-layout{grid-template-columns:1fr}.ns-managed-connector{position:relative;width:auto;min-height:64px;padding:.5rem 0}.ns-managed-connector-path{width:auto;flex-direction:column}.ns-managed-connector-line{width:1.5px;height:24px;flex:none}.ns-managed-connector-arrow{border-top:9px solid #d2d6e0;border-right:6px solid transparent;border-bottom:0;border-left:6px solid transparent}.ns-devin-connectors,.ns-devin-devboxes,.ns-devin-sessions{grid-template-columns:1fr}.ns-devin-desktop-layout{display:none}.ns-devin-mobile-layout{display:block}.ns-devin-mobile-lane+.ns-devin-mobile-lane{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--ns-diagram-border)}.ns-devin-mobile-connectors{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0 .5rem}.ns-devin-connector{min-height:80px}.ns-bazel-workers{grid-template-columns:1fr}}"},{"filePath":"style.css","content":":root{--namespace-radius-inline:0.25rem;--namespace-radius-control:0.375rem;--namespace-radius-container:0.5rem}#content-container,.almond-layout>div,.card,.chat-assistant-floating-input>div,.code-block,.frame,.pagination-next,.pagination-prev{border-radius:var(--namespace-radius-container)}.code-block [data-component-part=code-block-root],.frame>div{border-radius:inherit}#assistant-entry,#chat-assistant-textarea,#search-bar-entry,#search-input,.callout,.frame>.relative{border-radius:var(--namespace-radius-control)}.code-block-fade-overlay{border-radius:0 var(--namespace-radius-container) var(--namespace-radius-container) 0}#page-context-menu>button:first-child{border-radius:var(--namespace-radius-control) 0 0 var(--namespace-radius-control)}#page-context-menu>button:last-child{border-radius:0 var(--namespace-radius-control) var(--namespace-radius-control) 0}#content :not(pre)>code,#navigation-items li>a,#navigation-items li>button{border-radius:var(--namespace-radius-inline)}#navigation-items .nav-anchor>:is(svg, img),#navigation-items .sidebar-group-icon,#navigation-items [data-component-part=scroll-area-content]:has(>ul.nav-anchors),#navigation-items li>:is(a, button)>div[class=\"h-[1lh]\"]:first-child{display:flex;flex-direction:column}#navigation-items [data-component-part=scroll-area-content]>ul.nav-anchors{order:1;margin-top:1rem;padding-top:1rem;border-top:1px solid color-mix(in srgb,currentColor 10%,transparent)}#navigation-items [data-component-part=scroll-area-content]>ul.sidebar-group{margin-top:.5rem}#navigation-items [data-component-part=scroll-area-content]>ul.sidebar-group+div{margin-top:1rem}.tab-container{overflow:hidden;padding:0 1rem 1rem;border:1px solid color-mix(in srgb,currentColor 12%,transparent);border-radius:var(--namespace-radius-container)}.tab-container [data-component-part=tab-content]>[data-table-wrapper]:last-child{margin-bottom:0;padding-bottom:0}#content .katex-display>.katex{text-align:left}.compact-table table td{min-width:0}#navigation-items ul.sidebar-group>li.space-y-px+li.space-y-px{margin-top:.75rem}#navigation-items .my-2>.sidebar-group-header{margin-bottom:.625rem;font-size:.8125rem;line-height:1.625rem;font-weight:600;letter-spacing:-.02em;text-transform:none;opacity:1}#navigation-items ul.sidebar-group>li.space-y-px>button{font-size:.8125rem;font-weight:600;letter-spacing:-.02em;background-color:transparent}#navigation-items ul.sidebar-group>li.space-y-px>button:hover,#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>button:hover{background-color:color-mix(in srgb,currentColor 6%,transparent)}#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>button,#navigation-items ul.sidebar-group>li.space-y-px>ul>li>a{padding-left:3rem!important;font-size:.8125rem;font-weight:400;letter-spacing:-.02em}#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>ul>li[data-active-nav-item=true]>a,#navigation-items ul.sidebar-group>li.space-y-px>ul>li[data-active-nav-item=true]>a{color:#121516!important;background-color:rgb(18 21 22/6%)!important}.dark #navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>ul>li[data-active-nav-item=true]>a,.dark #navigation-items ul.sidebar-group>li.space-y-px>ul>li[data-active-nav-item=true]>a{color:#f4f4f5!important;background-color:rgb(255 255 255/8%)!important}#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>button{background-color:transparent}#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>button>div[class=\"h-[1lh]\"]:first-child{margin-left:-1.75rem}.dark #navigation-items img[src*=buildkite-mark]{filter:brightness(.7)}.dark img[src*=\"/icons/apple.svg\"]{filter:invert(1)}.dark img.tab-icon[src*=\"/icons/linux.svg\"]{filter:invert(.35) brightness(1.54)}#navigation-items ul.sidebar-group>li.space-y-px>ul>li.space-y-px>ul>li>a{padding-left:4rem!important;font-size:.8125rem;font-weight:400;letter-spacing:-.02em}@media (min-width:1024px){#sidebar-content{width:calc(16.5rem + 10px)}#content-container{margin-left:calc(16.5rem + 10px)}#navbar{container-type:inline-size}#navbar .nav-tabs{position:fixed;top:0;left:20rem;height:3.5rem;column-gap:2rem}#navbar div:has(>div>.nav-tabs){justify-content:flex-end}@container (max-width: 69rem){#navbar .navbar-link:has(>a[href=\"https://namespace.so/changelog\\"\]){display:none}}}@media (min-width:1280px){#content-container{padding-right:1.5rem;padding-left:3rem}#content-container>div{column-gap:1.5rem;justify-content:flex-start}#content-area{width:calc(100% - 13.5rem);max-width:52rem;flex:none}#content-side-layout{width:15rem;max-width:15rem;flex-basis:15rem}#content-side-layout>div{width:15rem;padding-left:1rem}#content-side-layout>div>div{width:14rem}}@media (min-width:1700px){#content-container>div{justify-content:center}}"},{"filePath":"reference/github-actions/runner-configuration.css","content":""},{"filePath":"workspaces/access.css","content":""},{"filePath":"platform/workspaces/access.css","content":""},{"filePath":"reference/devbox-cli/desktop.css","content":""}],"page":{"pagePath":"solutions/github-actions/caching","slug":"/solutions/github-actions/caching","pageMetadata":{"title":"Caching in GitHub Actions","sidebarTitle":"Overview","description":null,"href":"/solutions/github-actions/caching/index"},"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`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,OptimizedImage,Step,Steps}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Cache Volumes are NVMe-backed storage attached to your runner instances that persist data across GitHub Actions runs.\nThey are the primitive that every caching feature in this section builds on: container image pulls, git checkouts, toolchain downloads, action archives, and build-system caches are all applications layered on top of the same volume infrastructure.\nFor the underlying architecture, see `,_jsx(_components.a,{href:`/architecture/storage/cache-volumes`,children:`Cache Volumes in the storage documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`choosing-a-caching-solution`,children:`Choosing a caching solution`}),`\n`,_jsx(_components.p,{children:`You have three options to cache your workflow data with Namespace.\nPick based on how much workflow change you can tolerate and how predictable you need cache hits to be:`}),`\n`,_jsxs(CardGroup,{cols:3,children:[_jsx(Card,{title:`GitHub Actions Cache`,children:_jsx(_components.p,{children:`Works out of the box with no workflow changes. Best when you want a drop-in solution and the default behavior is good enough.`})}),_jsx(Card,{title:`Namespace Cache Volumes`,href:`#using-a-cache-volume`,children:_jsx(_components.p,{children:`Fully local NVMe storage with high IOPS and no upload/download time. Best for the fastest cache hits; expect occasional misses on early runs. Requires small workflow changes.`})}),_jsx(Card,{title:`Namespace Artifacts`,href:`/architecture/storage/artifact-storage`,children:_jsx(_components.p,{children:`Consistent cache hits from the first run, with explicit control over content and lifecycle. Best for expensive build outputs shared across jobs. Requires workflow changes.`})})]}),`\n`,_jsxs(_components.p,{children:[`There is a ramp-up period when starting to use Cache Volumes, where cache hits will be lower until there is enough distribution of your data. The more jobs you run, the better the cache hit ratio will get.\nLearn more about `,_jsx(_components.a,{href:`/architecture/storage/cache-volumes#cache-volume-onboarding`,children:`Cache Volume onboarding`}),`.`]}),`\n`,_jsx(`a`,{id:`cache-volumes`}),`\n`,_jsx(Heading,{level:`2`,id:`using-a-cache-volume`,children:`Using a cache volume`}),`\n`,_jsx(_components.p,{children:`Cache Volumes attach to a runner and expose a persistent directory that survives across runs.\nUnlike traditional caching solutions that require time-consuming uploads and downloads, Cache Volumes provide instant access to cached data through guaranteed cache locality.\nCache Volumes support very high concurrency through automatic forking and scale up to hundreds of GB to match your project needs.`}),`\n`,_jsxs(Steps,{titleSize:`h3`,children:[_jsxs(Step,{title:`Enable caching on your Runner Profile`,id:`enable-caching-on-your-runner-profile`,children:[_jsxs(_components.p,{children:[`Open the desired `,_jsx(_components.a,{href:`https://cloud.namespace.so/workspace/actions/profiles\`,children:\`Runner Profile`}),` and enable caching. The minimum cache size is 20 GB.`]}),_jsx(Frame,{style:{maxWidth:500,marginInline:`auto`},children:_jsx(OptimizedImage,{src:`https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=5982289968807a8fe2a14d22cce8f232\`,alt:\`runner profile cache configuration`,width:1600,height:690,\"data-og-width\":`1600`,\"data-og-height\":`690`,\"data-path\":`images/github-actions/runnerprofilecaching.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=280\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=d26c2f27fbde55679f5564cbb369e9eb 280w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=560\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=af108347c7f839406e23fe49623bd340 560w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=840\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=e40be9755d2b1ef5cf5ab0aa375532f9 840w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=1100\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=cfcdd3ec24e6d0a05823bfb87e9c8a1d 1100w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=1650\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=62fdd6c3e36ade716f1d51c3bb1bf340 1650w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/runnerprofilecaching.webp?w=2500\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=d519f1f6423c03c435cc882a36725015 2500w`})}),_jsxs(_components.p,{children:[`Enabling Cache Volumes turns on caching for the built-in software layers. Each layer has its own sub-toggle in the profile so you can narrow what is cached: `,_jsx(_components.a,{href:`/solutions/github-actions/caching/container-images`,children:`Container images`}),`, `,_jsx(_components.a,{href:`/solutions/github-actions/caching/git-checkouts`,children:`Git checkouts`}),`, `,_jsx(_components.a,{href:`/solutions/github-actions/caching/toolchains`,children:`Toolchains`}),`, and `,_jsx(_components.a,{href:`/solutions/github-actions/caching/actions`,children:`Actions`}),`.`]})]}),_jsxs(Step,{title:`Use the cache in your workflow`,id:`use-the-cache-in-your-workflow`,children:[_jsxs(_components.p,{children:[`The simplest way to start using the cache is to adopt `,_jsx(_components.a,{href:`/reference/github-actions/nscloud-cache-action`,children:_jsx(_components.code,{children:`nscloud-cache-action`})}),`.\nThe action supports many popular frameworks natively, but can also be used to cache arbitrary files or directories.`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Add the action to your workflow and select which framework you use. You can enable caching for multiple frameworks simultaneously:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Configure Go and Rust cache`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`namespacelabs/nscloud-cache-action@v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cache`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` go`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rust`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For a full list of supported frameworks, check out the `,_jsx(_components.a,{href:`/reference/github-actions/nscloud-cache-action`,children:`action reference`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`In case native support is not available yet, you can still make your framework work with Cache Volumes. Simply configure a list of paths to retain:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Configure custom cache`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`namespacelabs/nscloud-cache-action@v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/.cache/custom-tool`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /opt/shared-libraries`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Our `,_jsx(_components.a,{href:`mailto:support@namespace.so`,children:`support team`}),` can help you identify the optimal cache configuration.`]}),`\n`]}),`\n`]})]}),_jsxs(Step,{title:`Skip GitHub's action cache`,id:`skip-githubs-action-cache`,children:[_jsx(_components.p,{children:`After enrolling Namespace’s caching, disable GitHub’s builtin action caching.\nThis ensures that you avoid any superfluous network transfers, reducing the setup time of your workflow further.`}),_jsx(CodeBlock,{filename:``,highlight:`[5,11]`,numberOfLines:`12`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Setup Go`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/setup-go@v6`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` go-version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1.21\"`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cache`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Use Namespace caching instead`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Setup Node.js`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/setup-node@v6`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` node-version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"18\"`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` package-manager-cache`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Use Namespace caching instead`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cache`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`})]}),`\n`]})})})]})]}),`\n`,_jsxs(_components.p,{children:[`If your jobs run inside a container, you also need to mount the cache volume inside the container. See `,_jsx(_components.a,{href:`/solutions/github-actions/runner-controls/containerized-jobs`,children:`Running jobs in containers`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-you-can-cache`,children:`What you can cache`}),`\n`,_jsx(_components.p,{children:`The caching features below all use Cache Volumes.`}),`\n`,_jsx(Heading,{level:`3`,id:`container-images`,children:`Container Images`}),`\n`,_jsxs(_components.p,{children:[`Cache container image layers and the often expensive unpacking step, so repeated pulls complete in seconds.\nSee `,_jsx(_components.a,{href:`/solutions/github-actions/caching/container-images`,children:`Container Images`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`git-checkouts`,children:`Git Checkouts`}),`\n`,_jsxs(_components.p,{children:[`Cache a mirror of your git repository to speed up checkouts of large repositories, submodules, and Git LFS objects.\nSee `,_jsx(_components.a,{href:`/solutions/github-actions/caching/git-checkouts`,children:`Git Checkouts`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`toolchain-downloads`,children:`Toolchain Downloads`}),`\n`,_jsxs(_components.p,{children:[`Cache downloads from setup actions like `,_jsx(_components.code,{children:`actions/setup-go`}),`, `,_jsx(_components.code,{children:`actions/setup-python`}),`, and `,_jsx(_components.code,{children:`actions/setup-node`}),`.\nSee `,_jsx(_components.a,{href:`/solutions/github-actions/caching/toolchains`,children:`Toolchains`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`action-downloads`,children:`Action Downloads`}),`\n`,_jsxs(_components.p,{children:[`Cache the action archives your job downloads at startup, and use `,_jsx(_components.code,{children:`nscloud-cache-action`}),` as an `,_jsx(_components.code,{children:`actions/cache`}),` replacement.\nSee `,_jsx(_components.a,{href:`/solutions/github-actions/caching/actions`,children:`Actions`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`build-system-integrations`,children:`Build System Integrations`}),`\n`,_jsxs(_components.p,{children:[`Native caching presets for Bazel, Turborepo, Pants, Moonrepo, Gradle, and sccache.\nSee `,_jsx(_components.a,{href:`/solutions/github-actions/caching/build-systems`,children:`Build System Integrations`}),`.`]}),`\n`,_jsx(`a`,{id:`advanced-cache-controls`}),`\n`,_jsx(Heading,{level:`2`,id:`advanced-cache-volume-management`,children:`Advanced cache volume management`}),`\n`,_jsx(_components.p,{children:`Namespace cache volumes are separated at multiple levels to ensure security and prevent data leakage between different contexts.`}),`\n`,_jsx(Heading,{level:`3`,id:`isolation-levels`,children:`Isolation levels`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Workspace isolation`}),`: Each workspace maintains completely separate cache volumes.\nCaches from one workspace cannot be accessed by any other workspace, providing a strong security boundary between different organizational units or projects.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Runner Profiles`}),`: Different runner profiles use distinct cache volumes, even within the same workspace.\nThis ensures that builds running on different profiles don’t interfere with each other’s cached data by default.\n`,_jsx(_components.a,{href:`#sharing-a-cache`,children:`Sharing the cache between two profiles`}),` is possible.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Repository`}),`: Each repository using a specific runner profile gets its own separate cache volume.\nThe cache volume will be shared between all jobs running for a Git repository, but remains distinct from other repositories, even when they share the same runner profile configuration.\n`,_jsx(_components.a,{href:`#sharing-a-cache`,children:`Sharing the cache between two repositories`}),` is possible.`]}),`\n`,_jsxs(_components.p,{children:[`For scenarios requiring more control over the cache isolation boundary, `,_jsx(_components.a,{href:`#custom-cache-identity`,children:`custom cache tags can be specified`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`sharing-a-cache`,children:`Sharing a cache volume`}),`\n`,_jsx(_components.p,{children:`By default, Namespace isolates cache volumes. Each runner profile gets its own cache volume, and within a profile each repository gets its own too.`}),`\n`,_jsx(_components.p,{children:`Use a custom cache tag to have several jobs, profiles, or repositories reuse one cache. Every job that resolves to the same tag within a workspace attaches to the same cache volume.`}),`\n`,_jsxs(_components.p,{children:[`Append `,_jsx(_components.code,{children:`;overrides.cache-tag={tag}`}),` to the profile name. Two different profiles that set the same\ntag share one cache volume:`]}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[4,11]`,numberOfLines:`14`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runs-on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`namespace-profile-builds;overrides.cache-tag=my-shared-cache`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` steps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pnpm install`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` tests`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runs-on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`namespace-profile-e2e-tests;overrides.cache-tag=my-shared-cache`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` steps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pnpm run test`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`namespace-profile-builds`}),` and `,_jsx(_components.code,{children:`namespace-profile-e2e-tests`}),` are separate profiles with their own\nmachine shapes and features, but both jobs read and write the same `,_jsx(_components.code,{children:`my-shared-cache`}),` volume. This\nalso works across repositories: any repository whose jobs set `,_jsx(_components.code,{children:`overrides.cache-tag=my-shared-cache`}),`\njoins the same cache.`]}),`\n`,_jsxs(_components.p,{children:[`Every job sharing the tag can also update the cache contents. To let some of them read the cache\nwithout persisting their changes, see `,_jsx(_components.a,{href:`#protect-caches-from-updates`,children:`Protect caches from updates`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`custom-cache-identity`,children:`Custom cache identity`}),`\n`,_jsx(_components.p,{children:`For scenarios requiring full control over the cache isolation boundary, you can specify custom cache tags.`}),`\n`,_jsxs(_components.p,{children:[`To specify a custom cache tag when using a profile, append `,_jsx(_components.code,{children:`;overrides.cache-tag=new-tag-value`}),` to the profile name:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`runs-on: namespace-profile-my-profile;overrides.cache-tag=new-tag-value`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Because every job resolving to the same cache tag attaches to the same volume, this is also how you\nshare a cache across profiles or repositories. See `,_jsx(_components.a,{href:`#sharing-a-cache`,children:`Sharing a cache volume`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`protect-caches-from-updates`,children:`Protect caches from updates`}),`\n`,_jsxs(_components.p,{children:[`You can configure Cache Volumes to limit what git branches can perform updates to them.\nRestricting the source of cache updates is useful to avoid cache poisoning.\nWhen using this feature, all branches (including pull requests) can benefit from your cache, but only selected branches (e.g. `,_jsx(_components.code,{children:`main`}),`) may commit changes to it.`]}),`\n`,_jsxs(_components.p,{children:[`To specify which branches can update the cache volume, open the cache volume configuration, then\ncheck `,_jsx(_components.strong,{children:`Show Advanced features`}),`, and finally type the branch names.`]}),`\n`,_jsx(Frame,{style:{maxWidth:600,marginInline:`auto`},children:_jsx(OptimizedImage,{src:`https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=71842d8f7d56f730bcc39a8774976dbd\`,alt:\`branch cache configuration`,width:1294,height:438,\"data-og-width\":`1294`,\"data-og-height\":`438`,\"data-path\":`images/github-actions/protected-branches.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=280\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=266c0295e06de8c74d8b08d988ea446c 280w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=560\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=699c0416b64eb3f7713121ca5d43d369 560w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=840\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=df43e89b936b846e5e56bce8e55ed436 840w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=1100\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=aa1f86d734fa5908adcdc3bfa4c20939 1100w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=1650\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=4ffd28408e6e91b00fccce83572537b4 1650w, https://mintcdn.com/namespace-labs/QVtD1jw4ML2vd3TZ/images/github-actions/protected-branches.webp?w=2500\\u0026fit=max\\u0026auto=format\\u0026n=QVtD1jw4ML2vd3TZ\\u0026q=85\\u0026s=ce96058ff382f601ef6ee3625469d206 2500w`})}),`\n`,_jsx(_components.p,{children:`Any GitHub Actions job belonging to git branches that are not included in the allow-list, will be able to access the Cache Volumes, but their changes to the caches’ content will not be persisted in the end.\nYou may also use an asterisk as a placeholder to match a branch name pattern.`}),`\n`,_jsx(Heading,{level:`3`,id:`manage-cache-access-per-job`,children:`Manage cache access per job`}),`\n`,_jsx(_components.p,{children:`Instead of protecting your cache per branch, you can also select which jobs may write to the cache.\nThis lets you share a cache amongst multiple jobs while some are not allowed to update its contents.\nAny job without commit rights can still access the cache and can also change contents locally.\nBut any edits that it makes to the cache will be ignored for future runs.`}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/solutions/github-actions/caching/build-systems`,children:`Build System Integrations`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/solutions/github-actions/docker-builds`,children:`Docker builds`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/solutions/github-actions/caching/troubleshooting`,children:`Troubleshooting`})}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For advanced configuration see `,_jsx(_components.a,{href:`/reference/github-actions/runner-configuration`,children:`Runner Labels`}),`.`]})]})}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":"Caching in GitHub Actions","sidebarTitle":"Overview","description":null,"href":"/solutions/github-actions/caching/index"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Choosing a caching solution","slug":"choosing-a-caching-solution","depth":2,"children":[]},{"title":"Using a cache volume","slug":"using-a-cache-volume","depth":2,"children":[{"title":"Enable caching on your Runner Profile","slug":"enable-caching-on-your-runner-profile","depth":3,"children":[]},{"title":"Use the cache in your workflow","slug":"use-the-cache-in-your-workflow","depth":3,"children":[]},{"title":"Skip GitHub's action cache","slug":"skip-githubs-action-cache","depth":3,"children":[]}]},{"title":"What you can cache","slug":"what-you-can-cache","depth":2,"children":[{"title":"Container Images","slug":"container-images","depth":3,"children":[]},{"title":"Git Checkouts","slug":"git-checkouts","depth":3,"children":[]},{"title":"Toolchain Downloads","slug":"toolchain-downloads","depth":3,"children":[]},{"title":"Action Downloads","slug":"action-downloads","depth":3,"children":[]},{"title":"Build System Integrations","slug":"build-system-integrations","depth":3,"children":[]}]},{"title":"Advanced cache volume management","slug":"advanced-cache-volume-management","depth":2,"children":[{"title":"Isolation levels","slug":"isolation-levels","depth":3,"children":[]},{"title":"Sharing a cache volume","slug":"sharing-a-cache","depth":3,"children":[]},{"title":"Custom cache identity","slug":"custom-cache-identity","depth":3,"children":[]},{"title":"Protect caches from updates","slug":"protect-caches-from-updates","depth":3,"children":[]},{"title":"Manage cache access per job","slug":"manage-cache-access-per-job","depth":3,"children":[]}]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/namespace-labs/fa018fe02fd436c8/navigation.js","/docs/_mintlify/custom/namespace-labs/4276600b7cb636ff/legacy-anchor-redirects.js"],"subdomain":"namespace-labs","siteName":"Namespace Documentation","title":"Caching in GitHub Actions - Namespace Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T10:46:17.387Z","gitLastModified":"2026-09-22T09:40:17.000Z","originalFileLocation":"solutions/github-actions/caching/index.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=\"application-name\" content=\"Namespace Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_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=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Caching in GitHub Actions - Namespace Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Namespace Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://namespace.so/docs/solutions/github-actions/caching\\">\\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://namespace-labs.mintlify.app/\_mintlify/api/og/v2?division=Cache+Volumes\\u0026amp;title=Caching+in+GitHub+Actions\\u0026amp;theme=1f89d53762a6d5304d1c63c4\\u0026amp;signature=d1087581de129122fab6cc6094acacb3699cfecd27d9a3bb3a11f9ca3db88f81\\">\\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=\"Caching in GitHub Actions - Namespace Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://namespace-labs.mintlify.app/\_mintlify/api/og/v2?division=Cache+Volumes\\u0026amp;title=Caching+in+GitHub+Actions\\u0026amp;theme=1f89d53762a6d5304d1c63c4\\u0026amp;signature=d1087581de129122fab6cc6094acacb3699cfecd27d9a3bb3a11f9ca3db88f81\\">\\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=\"/docs/mintlify-assets/_mintlify/favicons/namespace-labs/kZKeJ4zhJEuE6_kI/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Namespace Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1C32FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://namespace.so/docs/solutions/github-actions/caching\\">\\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/solutions/github-actions/caching.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\\",\\"@graph\\":\[{\\"@type\\":\\"Organization\\",\\"@id\\":\\"https://namespace.so/#organization\\",\\"name\\":\\"Namespace Documentation\",\"url\":\"https://namespace.so\\",\\"logo\\":{\\"@type\\":\\"ImageObject\\",\\"url\\":\\"https://mintcdn.com/namespace-labs/qOJQ7kaWRgoS8lyv/logo-light.svg?fit=max\\u0026auto=format\\u0026n=qOJQ7kaWRgoS8lyv\\u0026q=85\\u0026s=6827b0c81c335badc1cef13b83383e1d\\"}},{\\"@type\\":\\"WebSite\\",\\"@id\\":\\"https://namespace.so/docs#website\\",\\"name\\":\\"Namespace Documentation\",\"url\":\"https://namespace.so/docs\\",\\"publisher\\":{\\"@id\\":\\"https://namespace.so/#organization\\"}},{\\"@type\\":\\"WebPage\\",\\"@id\\":\\"https://namespace.so/docs/solutions/github-actions/caching#webpage\\",\\"url\\":\\"https://namespace.so/docs/solutions/github-actions/caching\\",\\"name\\":\\"Caching in GitHub Actions\",\"dateModified\":\"2026-09-22T09:40:17.000Z\",\"isPartOf\":{\"@id\":\"https://namespace.so/docs#website\\"},\\"breadcrumb\\":{\\"@id\\":\\"https://namespace.so/docs/solutions/github-actions/caching#breadcrumb\\"}},{\\"@type\\":\\"BreadcrumbList\\",\\"@id\\":\\"https://namespace.so/docs/solutions/github-actions/caching#breadcrumb\\",\\"itemListElement\\":\[{\\"@type\\":\\"ListItem\\",\\"position\\":1,\\"name\\":\\"Products\\",\\"item\\":\\"https://namespace.so/docs/solutions/github-actions/index\\"},{\\"@type\\":\\"ListItem\\",\\"position\\":2,\\"name\\":\\"GitHub Actions\",\"item\":\"https://namespace.so/docs/solutions/github-actions/index\\"},{\\"@type\\":\\"ListItem\\",\\"position\\":3,\\"name\\":\\"Cache Volumes\",\"item\":\"https://namespace.so/docs/solutions/github-actions/caching/index\\"},{\\"@type\\":\\"ListItem\\",\\"position\\":4,\\"name\\":\\"Caching in GitHub Actions\",\"item\":\"https://namespace.so/docs/solutions/github-actions/caching\\"}\]},{\\"@type\\":\[\\"Article\\",\\"TechArticle\\"\],\\"@id\\":\\"https://namespace.so/docs/solutions/github-actions/caching#article\\",\\"headline\\":\\"Caching in GitHub Actions\",\"name\":\"Caching in GitHub Actions\",\"url\":\"https://namespace.so/docs/solutions/github-actions/caching\\",\\"mainEntityOfPage\\":{\\"@id\\":\\"https://namespace.so/docs/solutions/github-actions/caching#webpage\\"},\\"dateModified\\":\\"2026-09-22T09:40:17.000Z\\",\\"publisher\\":{\\"@id\\":\\"https://namespace.so/#organization\\"},\\"isPartOf\\":{\\"@id\\":\\"https://namespace.so/docs#website\\"}}\]}\\u003c/script>\\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\\",\\"@type\\":\\"WebSite\\",\\"name\\":\\"Namespace Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\\"}}\\u003c/script>","siteName":"Namespace Documentation","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"history","href":"https://namespace.so/changelog"},{"anchor":"Trust Center (SOC2)","icon":"shield-check","href":"https://trust.namespace.so/"},{"anchor":"Status","icon":"activity","href":"https://namespace-status.com/"},{"anchor":"Support","icon":"message-circle","href":"https://namespace.so/support"}\]},"products":\[{"product":"Products","description":"Turnkey products built on the Namespace platform","tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Namespace Documentation","sidebarTitle":"Overview","href":""},{"group":"Products","pages":[{"group":"GitHub Actions","icon":"github","pages":[{"title":"Accelerate your GitHub Actions with Namespace","sidebarTitle":"Getting Started","description":null,"href":"/solutions/github-actions/index"},{"group":"Cache Volumes","pages":[{"title":"Caching in GitHub Actions","sidebarTitle":"Overview","href":"/solutions/github-actions/caching/index"},{"title":"Container Images","description":null,"href":"/solutions/github-actions/caching/container-images"},{"title":"Git Checkouts","href":"/solutions/github-actions/caching/git-checkouts"},{"title":"Toolchains","sidebarTitle":"Toolchains","href":"/solutions/github-actions/caching/toolchains"},{"title":"Actions","sidebarTitle":"Actions","href":"/solutions/github-actions/caching/actions"},{"title":"Build System Integrations","sidebarTitle":"Build Systems","href":"/solutions/github-actions/caching/build-systems"},{"title":"Troubleshooting cache volumes","sidebarTitle":"Troubleshooting","href":"/solutions/github-actions/caching/troubleshooting"}]},{"title":"Fast repository checkouts with Git snapshots","sidebarTitle":"Git Snapshots","href":"/solutions/github-actions/git-snapshots"},{"title":"Optimizing Docker build performance","sidebarTitle":"Docker Builds","href":"/solutions/github-actions/docker-builds"},{"title":"Custom base images for GitHub Actions","sidebarTitle":"Custom Base Images","href":"/solutions/github-actions/custom-base-images/index"},{"group":"Debugging","pages":[{"title":"Debugging GitHub Actions","sidebarTitle":"Overview","href":"/solutions/github-actions/debugging/index"},{"title":"Interactive Access","href":"/solutions/github-actions/debugging/interactive-access"},{"title":"Remote Display","href":"/solutions/github-actions/debugging/remote-display"},{"title":"Performance Metrics","href":"/solutions/github-actions/debugging/performance-metrics"},{"title":"Advanced Logging","href":"/solutions/github-actions/debugging/logging"},{"title":"Out of memory (OOM) detection","sidebarTitle":"OOM Detection","href":"/solutions/github-actions/debugging/oom-detection"},{"title":"Crash Dumps","href":"/solutions/github-actions/debugging/crash-dumps"},{"title":"Queue Time","href":"/solutions/github-actions/debugging/queue-time"}]},{"group":"Runner Controls","pages":[{"title":"Runner Controls","sidebarTitle":"Overview","href":"/solutions/github-actions/runner-controls"},{"title":"Concurrent runners","href":"/solutions/github-actions/runner-controls/concurrent-runners"},{"title":"Job Ordering \u0026 Priority","sidebarTitle":"Job Ordering","href":"/solutions/github-actions/runner-controls/job-ordering"},{"title":"Privileged Workflows","sidebarTitle":"Privileged Workflows","href":"/solutions/github-actions/runner-controls/privileged-workflows"},{"title":"Landlock","sidebarTitle":"Landlock","href":"/solutions/github-actions/runner-controls/landlock"},{"title":"Swap Space","sidebarTitle":"Swap Space","href":"/solutions/github-actions/runner-controls/swap"},{"title":"Tailscale","sidebarTitle":"Tailscale","href":"/solutions/github-actions/runner-controls/tailscale"},{"title":"Access Levels","sidebarTitle":"Access Levels","href":"/solutions/github-actions/runner-controls/access-levels"},{"title":"Running jobs in containers","sidebarTitle":"Containerized Jobs","href":"/solutions/github-actions/runner-controls/containerized-jobs"}]},{"title":"Optimizing Usage","href":"/solutions/github-actions/optimizing-usage"},{"title":"Runner Labels","sidebarTitle":"Runner Labels","href":"/reference/github-actions/runner-configuration"},{"group":"Actions","expanded":false,"pages":[{"title":"nscloud-setup","href":"/reference/github-actions/nscloud-setup"},{"title":"nscloud-setup-buildx-action","href":"/reference/github-actions/nscloud-setup-buildx-action"},{"title":"nscloud-cluster-action","href":"/reference/github-actions/nscloud-cluster-action"},{"title":"nscloud-cache-action","href":"/reference/github-actions/nscloud-cache-action"},{"title":"nscloud-checkout-action","href":"/reference/github-actions/nscloud-checkout-action"},{"title":"nscloud-expose-kubernetes-action","href":"/reference/github-actions/nscloud-expose-kubernetes-action"},{"title":"breakpoint-action","href":"/reference/github-actions/breakpoint"},{"title":"upload-artifact","href":"/reference/github-actions/upload-artifact"},{"title":"download-artifact","href":"/reference/github-actions/download-artifact"},{"title":"setup-turbocache","href":"/reference/github-actions/setup-turbocache"}]}]},{"group":"Devboxes","icon":"container","pages":[{"title":"High-Performance Developer Environments with Devboxes","sidebarTitle":"Getting Started","href":"/devbox/index"},{"group":"Managing Devboxes","expanded":false,"pages":[{"title":"Devbox Lifecycle","sidebarTitle":"Lifecycle","href":"/devbox/lifecycle"},{"title":"Devbox Blueprints","sidebarTitle":"Blueprints","href":"/devbox/blueprint"},{"title":"Devbox Services","sidebarTitle":"Services","href":"/devbox/services"},{"title":"Shareable URLs","href":"/devbox/url"},{"title":"Custom Images","href":"/devbox/images"}]},{"group":"Working in a Devbox","expanded":false,"pages":[{"title":"Connecting to a Devbox","sidebarTitle":"SSH \u0026 Sessions","href":"/devbox/connecting"},{"title":"Executing Commands","href":"/devbox/exec"},{"title":"Running long tasks","sidebarTitle":"Long Running Tasks","href":"/guides/devbox/long-running-tasks"},{"title":"Computer Controls","sidebarTitle":"Computer Use","href":"/devbox/computer-use"},{"title":"Remote Desktop","sidebarTitle":"Remote Desktop","href":"/devbox/remote-desktop"},{"title":"Open IDE","href":"/devbox/ides"}]},{"group":"Managed Agents","tag":"Integrations","expanded":false,"pages":[{"title":"Amp Orbs","sidebarTitle":"Amp Orbs","href":"/integrations/amp"},{"title":"Claude Managed Agents","sidebarTitle":"Claude Managed Agents","href":"/integrations/claude"},{"title":"Cursor Cloud Agents","sidebarTitle":"Cursor Cloud Agents","href":"/integrations/cursor"},{"title":"Devin on Devboxes","sidebarTitle":"Devin","href":"/integrations/devin"}]}]},{"group":"Bazel","icon":"hammer","pages":[{"title":"Speed up your Bazel builds with Namespace","sidebarTitle":"Introduction","href":"/bazel/index"},{"title":"Bazel cache","sidebarTitle":"Caching","href":"/bazel/cache"},{"title":"Bazel Remote Execution","sidebarTitle":"Remote Build Execution","href":"/bazel/execution"},{"title":"Bazel observability","sidebarTitle":"Observability","href":"/bazel/observability"}]},{"group":"Docker Builders","icon":"container","pages":[{"title":"Speed up your Docker Builds with Namespace","sidebarTitle":"Getting Started","href":"/solutions/docker-builders/index"},{"title":"Container Registry","href":"/solutions/docker-builders/registry"},{"title":"Docker Build Observability","sidebarTitle":"Tracing \u0026 Logs","href":"/solutions/docker-builders/tracing-and-logs"}]},{"group":"Buildkite Agents","icon":"workflow","pages":[{"title":"Run Buildkite Jobs on Namespace","sidebarTitle":"Getting Started","href":"/solutions/buildkite-agents/index"},{"title":"Managing Buildkite Queues","sidebarTitle":"Managing Queues","href":"/solutions/buildkite-agents/managing-queues"},{"title":"Configure Buildkite Agents","sidebarTitle":"Configuration","href":"/solutions/buildkite-agents/configuration"},{"title":"Fast repository checkouts with Git snapshots","sidebarTitle":"Git Snapshots","href":"/solutions/buildkite-agents/git-snapshots"}]}]},{"group":"Platform","pages":[{"group":"Compute","icon":"cpu","pages":[{"title":"Compute Platform","sidebarTitle":"Overview","href":"/architecture/compute/index"},{"title":"Linux","href":"/architecture/compute/linux"},{"title":"macOS","href":"/architecture/compute/macos"},{"title":"Windows","href":"/architecture/compute/windows"},{"title":"Observability","href":"/architecture/compute/observability"},{"title":"SSH / Remote Display with Namespace Compute","sidebarTitle":"SSH / Remote Display","href":"/architecture/compute/ssh-remote-display"},{"title":"Machine Shapes","href":"/architecture/compute/machine-shapes"},{"title":"Resource Limits","href":"/architecture/compute/resource-limits"}]},{"group":"Storage","icon":"database","pages":[{"title":"Storage","sidebarTitle":"Overview","href":"/architecture/storage/index"},{"title":"Cache Volumes","href":"/architecture/storage/cache-volumes"},{"title":"Container Registry","href":"/architecture/storage/container-registry"},{"title":"Artifact Storage","href":"/architecture/storage/artifact-storage"},{"title":"Secrets","href":"/architecture/storage/secrets"}]},{"group":"Networking","icon":"network","pages":[{"title":"Networking","sidebarTitle":"Overview","href":"/architecture/networking/index"},{"title":"Ingress","href":"/architecture/networking/ingress"},{"title":"Network Performance Optimizations","sidebarTitle":"Performance","href":"/architecture/networking/performance"},{"title":"Network Security","sidebarTitle":"Security","href":"/architecture/networking/security"},{"title":"Egress policies","href":"/security/egress-policy"}]}]},{"group":"Administration","pages":[{"group":"Workspaces","icon":"briefcase-business","pages":[{"title":"Workspaces","sidebarTitle":"Overview","href":"/workspaces/index"},{"title":"Workspace Access Controls","sidebarTitle":"Access","href":"/workspaces/access"},{"title":"Billing \u0026 Included Amounts","sidebarTitle":"Billing and limits","href":"/workspaces/billing-and-limits"},{"title":"Data Residency for Workspaces","sidebarTitle":"Data residency","href":"/workspaces/data-residency"},{"title":"Security \u0026 Compliance","sidebarTitle":"Security","href":"/workspaces/security"},{"title":"Audit Logs","sidebarTitle":"Audit logging","href":"/security/auditlog"},{"title":"Permissions","href":"/security/permissions"}]},{"group":"Federation","icon":"shield-check","pages":[{"title":"Workload Federation","sidebarTitle":"Overview","href":"/federation/index"},{"title":"Workload Federation with AWS","sidebarTitle":"AWS","href":"/federation/aws"},{"title":"Workload Federation with GCP","sidebarTitle":"GCP","href":"/federation/gcp"},{"title":"Workload Federation with OpenID Connect","sidebarTitle":"OpenID","href":"/federation/openid"},{"title":"Identity Federation with GitHub Actions","sidebarTitle":"Github Actions","href":"/federation/github-actions"},{"title":"Identity Federation with CircleCI","sidebarTitle":"CircleCI","href":"/federation/circleci"},{"title":"Identity Federation with RWX","sidebarTitle":"RWX","href":"/federation/rwx"}]},{"group":"Dashboard","icon":"layout-dashboard","pages":[{"title":"GitHub Actions Overview","sidebarTitle":"GitHub Actions","href":"/dashboard/github-actions"},{"title":"Builds UI","sidebarTitle":"Builds","href":"/dashboard/builds"},{"title":"Registry UI","sidebarTitle":"Registry","href":"/dashboard/registry"},{"title":"Usage Explorer","href":"/dashboard/usage-explorer"}]}]}]},{"tab":"Integrations","icon":"blocks","pages":[{"title":"Integrations","href":"/integrations/turborepo"}]},{"tab":"CLI","icon":"square-terminal","pages":[{"title":"CLI","href":"/reference/cli"}]},{"tab":"SDK","icon":"braces","pages":[{"title":"SDK","href":"/reference/sdk"}]},{"tab":"MCP","icon":"plug","pages":[{"title":"MCP","href":"/reference/mcp"}]}]},{"product":"Platform","description":"Lower-level primitives to build your own","pages":[{"title":"Platform","href":"/platform"}]}]},"title":"Caching in GitHub Actions - Namespace Documentation","buildId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","deploymentId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-5VlDM5Io.js","DynamicMarkdown-DO1Fz7ar.js","zoom-image-lightbox-uyuQJRFs.js","lightbox-handle-r17bVUz3.js"]}