---
schema_version: "1"
id: 561275969bfe68f6bfc0dff0cf882c84e992d1c6066faee40f50bb0aab51d48a
title: Visibility Enum
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_enum_cache_Visibility.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_cache_Visibility.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0616d7b52d3f4b234f24f8fb503f32e98e3354a67ceff4b4d66654573d318fff
description: Use the Cache.Visibility enumeration in the Cache.Session or Cache.Org methods to indicate whether a cached value is visible only in the value’s namespace or in all namespaces.
---
# Visibility Enum

Use the Cache.Visibility enumeration in the Cache.Session or Cache.Org methods to indicate whether a cached value is visible only in the value’s namespace or in all namespaces.

## Enum Values

The following are the values of the Cache.Visibility enum.

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1814579e65">Value</th>

              <th class="featureTableHeader  " id="d1814579e68">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1814579e65" data-title="Value"><samp class="codeph apex_code">ALL</samp></td>

              <td class="entry" headers="d1814579e68" data-title="Description">The cached value is available to Apex code executing from any namespace. This
                is the default state.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1814579e65" data-title="Value"><samp class="codeph apex_code">NAMESPACE</samp></td>

              <td class="entry" headers="d1814579e68" data-title="Description">
                <p class="p">The cached value is available to Apex code executing from the same namespace.</p>

                <p class="p">If a key has the <samp class="codeph apex_code">Visibility.NAMESPACE</samp>
                  attribute, a <samp class="codeph apex_code">get</samp> method initiated from a
                  different namespace returns <samp class="codeph apex_code"><span class="keyword">null</span></samp>.</p>

              </td>

            </tr>

          </tbody>

        </table>