Giter Club home page Giter Club logo

purge-surgeon's Introduction

Purge Surgeon

Avionos

Overview

The Purge Surgeon is an OSGi bundle for the Adobe Experience Manager (AEM) platform that uses the Akamai Fast Purge API to purge content from Akamai when content is replicated.

The included replication preprocessor is triggered by replication requests for a configurable set of content paths. When content is activated, deactivated, or deleted, the preprocessor creates a Sling job that sends a request using the Akamai Fast Purge API to invalidate or delete the externalized page/asset URL.

The Purge Surgeon API also includes methods for purging edge content by CP (content provider) code or cache tag.

Compatibility

Bundle Version AEM Version(s)
0.x.x 6.5

Installation

  1. Add the following dependencies to your AEM project:
<dependency>
    <groupId>com.avionos.aem.akamai</groupId>
    <artifactId>purge-surgeon</artifactId>
    <version>0.1.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.akamai.edgegrid</groupId>
    <artifactId>edgegrid-signer-core</artifactId>
    <version>4.0.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.akamai.edgegrid</groupId>
    <artifactId>edgegrid-signer-apache-http-client</artifactId>
    <version>4.0.0</version>
    <scope>provided</scope>
</dependency>

All of the above OSGi bundles need to be installed in AEM by embedding in the Content Package Maven Plugin (or installing manually).

  1. Add a service user mapping for the purge-surgeon bundle.

  2. Configure the Akamai services as outlined below.

Configuration

Akamai Purge Replication Preprocessor Configuration

Enable/disable the Akamai replication preprocessor and configure which resource paths should be purged and/or excluded from purging.

Akamai Edge Grid Client Configuration

Configure the Akamai network, hostname, and credentials (access token, client token, client secret) in addition to HTTP client timeouts and connection parameters.

URL Externalizers

Projects utilizing the Purge Surgeon may provide a service implementing the com.avionos.aem.akamai.purgesurgeon.externalizer.AkamaiUrlExternalizer interface to customize how URLs are externalized for replicated resource paths. See the getUrls() method in com.avionos.aem.akamai.purgesurgeon.replication.AkamaiPurgeReplicationPreprocessor for the default externalization behavior if no custom URL externalizer service is implemented.

Edge Grid Client API

The Purge Surgeon API can be used without enabling (or in addition to) replication preprocessing to purge content from Akamai edge servers by CP code or cache tag.

For example, using the AEM Groovy Console, executing the following script would purge edge content for the CP codes "123" and "456":

def akamaiEdgeGridClient = getService("com.avionos.aem.akamai.purgesurgeon.client.AkamaiEdgeGridClient")

akamaiEdgeGridClient.invalidateCpCodes([123, 456])

Javadoc

https://javadoc.io/doc/com.avionos.aem.akamai/purge-surgeon/latest/index.html

Versioning

Follows Semantic Versioning guidelines.

purge-surgeon's People

Stargazers

Matija Kovaček avatar  avatar Ryan Hauk avatar Kevin Roberts avatar Canh Nguyen Van avatar  avatar

Watchers

James Cloos avatar Paul Michelotti avatar  avatar

purge-surgeon's Issues

Cannot derive user name for bundle purge-surgeon [606] and sub service null

Hi,

I was following instruction to use this but I get
Cannot derive user name for bundle purge-surgeon [606] and sub service null

In the readme, it says "Add a service user mapping for the purge-surgeon bundle."

I can add this but is not specified which service user, also in the codebase I see
final ResourceResolver resourceResolver = resourceResolverFactory.getServiceResourceResolver(null)

Instead of null should be some specific service user

Page Move Operation Getting Failed

There is an issue on purge surgeon for the Page Move operation. When we are using page move operation which internally calls the DELETE operation, Akamai purge surgeon captures the DELETE event and tries to get the resource for the deleted path. The resource is null since it has been moved to a new location. Due to this, the automatic publishing which happens in move operation is failing and in my inbox I am getting ayncPageMove failed notification.

Looks like the purge surgeon doesn't work with move operation but is also breaking the OOTB publishing in the page move operation.

If we disable Akamai Purge Replication Preprocessor Configuration in ConfigMgr then the replication works. I have also checked deleting our custom code for Akamai with Akamai Purge Replication Preprocessor Configuration enabled just to be sure and the replication failed in this case as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.