Clearing the edge server cache



Deleting files from the edge server cache

Edge servers do not delete content automatically; you must delete unused files to manage disk usage. Edge servers update the timestamp of a file each time the file is used. You can use the timestamp to determine when a cached file was used.

Manage the edge server cache in Windows

You can create a weekly scheduled task to clear the edge server cache.

  1. Create a cache.bat file to empty the cache directory. The entry in the cache.bat file has the following syntax:

    del /Q /S <cache_directory>\*.*
  2. Run the cache.bat file and verify that it deletes files in the cache directory.

    The directory structure remains and any files currently locked by the edge server are not deleted; this is expected behavior.

  3. Select Control Panel > Scheduled Tasks > Add Scheduled Task.

  4. Select cache.bat as the new file to run.

  5. Replicate this procedure on each edge server.

Manage the edge server cache in Linux

  1. Create a shell script named cache.sh to empty the cache directory. The cache.sh script has the following syntax:

    find <cache_directory> -name "*.flv" -exec rm-f{}\; 
    find <cache_directory> -name "*.mp3" -exec rm-f{}\; 
    find <cache_directory> -name "*.mp4" -exec rm-f{}\;
    Note: You can add any additional file types to the script.
  2. Verify that the script is executable by running the following command:

    $ chmod 700 cache.sh
  3. Run cache.sh to verify that it deletes the correct files in the cache directory.

  4. Use the cron utility to schedule cache.sh to run. (For details about the cron utility, see the documentation for your Linux distribution.)