How NetStorage serves content from archives

When serving from an archive file, NetStorage treats it as a directory within the hierarchy of your NetStorage content.

Below are some example scenarios.

Example 1: One instance of a target file exists

You might upload an archive file to the following directory in NetStorage:

/<cp_code>/a/b/c.zip

If an EdgeServer then sends an end user request for <domain name>.download.akamai.com/<cp_code>/a/b/c/d/e.html, the following will occur:

  1. NetStorage begins by looking for the full path.
  2. If the file is not found, it begins searching backward up the path: .../cp_code/a/b/c/d.zip
  3. If the file is not found there, it will look for the following: .../cp_code/a/b/c.zip
  4. Finding that file, NetStorage looks inside the archive’s index for /d/e.html, which it retrieves and serves to the end user.

Example 2: Two Zip files exist along the requested path

Using the same scenario in the example above, let's assume there are two zip files along the same path.

  • .../cp_code/a/b.zip
  • .../cp_code/a/b/c.zip

If an end user requests .../cp_code/a/b/c/d/e.html , the following occurs:

  1. NetStorage limits its search to the archive furthest along a given path. So, in this case NetStorage searches c.zip, because it's found first. As a result, either of the following occur:
    1. If c.zip contains a file named /d/e.html, that file is served.
    2. If c.zip does not contain the file, a 302 error is returned, even if a b.zip archive exists, and it actually contains the file, /c/d/e.html.

Ensure that you take into account when structuring your content.

You can override files inside an archive file

To do so, you need to upload them individually, external to the archive. Keep in mind, however, that the upload path must match that of the file in the archive. For example, let's assume you have the following archive:

“.../cp_code/a/b/c.zip”

If that archive contains the file, d/e.html, then the overriding file must be uploaded to:

“.../cp_code/a/b/c/d/e.html”