Purge Cache

Once a file is delivered through CDN Link, that means the file is distributed to 200+ Cloud Cache servers around the world and also stored in our internal caches.

Let's say you have a published image called john.imagemash.io/w_100/logos/logo.png, even if you delete the object from your storage or rename it, the file will be accessible from john.imagemash.io/w_100/logos/logo.png. Because it is still a valid file in Caches. Then you have a couple of options to overcome this situation.

  • Add a dummy query to your file. (Random string. Split with ? ) Eg. john.imagemash.io/w_100/logos/logo.png?1234

  • Change the name of your file and use the new one. Eg. /logos/logo_v2.png

  • Change the folder of your file. Move, copy, or upload to another directory and use the new one. Eg. /newLogos/logo.png

  • Use Cache Purging. Read below.

In order to purge caches, you have 2 options:

  • By creating a new purge request through your Dashboard

  • By using our Purge Cache API

Purge path requirements

In order to purge a file or path, your input should satisfy at least 1 of the conditions below

imagemash will purge all of your files whose paths begin with your input. Consider your input as a search string.

  1. The path should be the complete path of the file. That means a valid file path and an extension should exist. Valid Examples: βœ… /logo.png βœ… /company/logo.png Invalid Examples: ❌/logo ❌/company/ ❌/logo.png/

  2. The path should be at least 15 characters long. That means it could be a complete path, part of the path, or an incomplete path. Valid Examples: βœ… /companies/my_company βœ… /companies/my_com (It will purge all file paths that start with this value) βœ… /my_image_repository βœ… /my_image_repository/ βœ… /img.png (Valid because it satisfies the first condition) Invalid Examples: ❌/logo ❌/company/ ❌/company/imgs

  3. The path should be nested in at least 2 folders. That means it could be a complete path, part of the path, or an incomplete path. Valid Examples: βœ… /img/big/ βœ… /img/big/my_ (It will purge all file paths that start with this value) βœ… /img/big/logo.png βœ… /my_company_big/ (Valid because it satisfies the second condition)

    Invalid Examples: ❌ /companies/ ❌ /company/ ❌ /company/imgs

Last updated