Velir / akamai-ccu-rest-api-connector

15 stars 12 forks source link

Paths to be invalidated #6

Closed pun-ky closed 5 years ago

pun-ky commented 7 years ago

Let's say that I have a site structure with brands, e.g: /content/company/brand1 /content/dam/company/brand1

What will happen if

ccuManager.purgeByUrls(["http://www.my-server.com/company/brand1", "http://www.mysite.com/dam/company/brand1"])

it will invalidate all nested paths under /content/company/brand1 or only this node? Do I have to list all paths under my brand to invalidate them or only have to specify root node?

kairas commented 7 years ago

The API uses the CCU Purge API which does not support wildcard or nested paths, only specific URLs.

The API also supports Content Provider (CP) Codes which can provide better control over purging. https://developer.akamai.com/api/purge/ccu/overview.html#concepts

Content Provider (CP) Code: A CP code identifies a set, typically a subset, of content on your origin server. CP codes also provide additional granularity in reports and to track billing. Each contract has at least one CP code associated with it. You cannot apply the same CP code to content under more than one contract. If you are using Property Manager, see the Property Manager API (PAPI) to retrieve a list of CP codes available for a selected contract and group. PAPI also allows you to generate new CP codes, assign them to properties, and apply them within property rules.

If you would like to put this business logic into code, you can create an event listener waiting for the activation of specific paths or content types. You could then use a traverser or query to collect a list of related URLs to that specific activation.