---
updatedAt: 2026-05-11T22:37:01.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/powershell/llms.txt
---

# Akamai cache

Clear-AkamaiCache

## Synopsis

Purge Akamai cache data.

## Syntax

```powershell URL (Default)
Clear-AkamaiCache -URLs <String[]> [-Method <String>] [-Network <String>] [-EdgeRCFile <String>] [-Section <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```
```powershell CP code
Clear-AkamaiCache -CPCodes <Int32[]> [-Method <String>] [-Network <String>] [-EdgeRCFile <String>] [-Section <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```
```powershell Tag
Clear-AkamaiCache -Tags <String[]> [-Method <String>] [-Network <String>] [-EdgeRCFile <String>] [-Section <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## Description

Purges content from the Akamai cache on either the staging or production network.

You can purge content by either the URL, CP code, or cache tag.

You can also provide multiple entries as comma-separated strings.

Additionally, you can specify the method to use when purging content, either `invalidate` or `delete`.

## Parameters

<table>
  <tbody>
    <tr>
      <td class="ps-td"><code>&#8209;AccountSwitchKey</code></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>An account credential key that lets you move between accounts when using an API client enabled for multiple accounts. To find account switch keys, use <a href="https://techdocs.akamai.com/powershell/docs/get-accountswitchkey">Get-AccountSwitchKey</a>.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;CPCodes</code><br/><span style="color: red; padding-left: 11px; font-size: 13px;"><em>Conditionally required</em></span></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Parameter sets: <code>CP code</code></span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>A comma-separated string of CP Code IDs to purge.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;EdgeRCFile</code></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>Your EdgeGrid resource file to authenticate your command. Defaults to <code>~/.edgerc</code>.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;Method</code></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Accepted values: <code>invalidate</code>, <code>delete</code></span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>The purging method, either <code>invalidate</code> or <code>delete</code>. If using <code>invalidate</code>, subsequent requests for an object go forward with an <code>If-Modified-Sinc</code>' revalidation request. If using <code>delete</code>, it removes the entry from the cache entirely.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;Network</code></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Accepted values: <code>staging</code>, <code>production</code></span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>The network on which to remove the object(s), either <code>staging</code> or <code>production</code>.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;Section</code></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>The section name in your EdgeGrid resource file to retrieve authentication credentials from. Defaults to <code>default</code>.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;Tags</code><br/><span style="color: red; padding-left: 11px; font-size: 13px;"><em>Conditionally required</em></span></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Parameter sets: <code>Tag</code></span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>A comma-separated string of cache tags to purge.</p>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ps-td"><code>&#8209;URLs</code><br/><span style="color: red; padding-left: 11px; font-size: 13px;"><em>Conditionally required</em></span></td> 
      <td class="ps-tableinner">
        <div class="ps-metadata">
          <span class="ps-param-metadata">String</span>
          <span class="ps-param-metadata">Parameter sets: <code>URL</code></span>
          <span class="ps-param-metadata">Pipeline input: False</span>
        </div>
        <div>
          <p>A comma-separated string of URLs to purge.</p>
        </div>
      </td>
    </tr>
  </tbody>
</table>

## Related Links

[User Guide: Purge](https://techdocs.akamai.com/powershell/docs/purge)