Giter Club home page Giter Club logo

cacheable-renditions's Introduction

Cacheable Renditions

Avionos

Overview

The Cacheable Renditions OSGi bundle for the Adobe Experience Manager (AEM) platform provides Dispatcher-cacheable paths for asset renditions. By default, AEM rendition paths use a suffix to specify the rendition name, which can prevent these assets from being cached in Dispatcher when there is collision between the rendition path and the base asset path. The CacheableRendition implementation and servlet provided in this bundle create an alternate rendition path that uses a new extension that prevents this collision and allows the asset to be cached in Dispatcher in the same manner as the original asset. The default rendition path and rendering behavior is not altered.

Cacheable Rendition Path Syntax

Asset Path Default Rendition Path Cacheable Rendition Path
/content/dam/avionos/images/one.png /content/dam/avionos/images/one.png/jcr:content/renditions/cq5dam.thumbnail.48.48.png /content/dam/avionos/images/one.png.rendition/cq5dam.thumbnail.48.48.png

Usage

// get cacheable rendition from resource
final CacheableRendition cacheableRendition = resourceResolver.getResource("/content/dam/avionos/images/one.png/jcr:content/renditions/cq5dam.thumbnail.48.48.png")
    .adaptTo(CacheableRendition.class);

assertEquals("/content/dam/avionos/images/one.png.rendition/cq5dam.thumbnail.48.48.png", cacheableRendition.getPath());
// get cacheable rendition from rendition
final CacheableRendition cacheableRendition = resourceResolver.getResource("/content/dam/avionos/images/one.png")
    .adaptTo(Asset.class)
    .getRendition("cq5dam.thumbnail.48.48.png")
    .adaptTo(CacheableRendition.class);

assertEquals("/content/dam/avionos/images/one.png.rendition/cq5dam.thumbnail.48.48.png", cacheableRendition.getPath());

Compatibility

Bundle Version AEM Version(s)
1.0.0 6.5

Installation

Add the bundle as a Maven dependency to an existing project's OSGi bundle pom.xml:

<dependency>
    <groupId>com.avionos.aem.cacheablerenditions</groupId>
    <artifactId>cacheable-renditions</artifactId>
    <version>1.0.0</version>
    <scope>provided</scope>
</dependency>

...and also add to the project's UI pom.xml as both a dependency and an embedded bundle in the content-package-maven-plugin configuration, if using:

<build>
    <plugins>
        <plugin>
            <groupId>com.day.jcr.vault</groupId>
            <artifactId>content-package-maven-plugin</artifactId>
            <version>0.5.1</version>
            <extensions>true</extensions>
            <configuration>
                <embeddeds>
                    <embedded>
                        <groupId>com.avionos.aem.cacheablerenditions</groupId>
                        <artifactId>cacheable-renditions</artifactId>
                        <target>/apps/avionos/install</target>
                    </embedded>
                </embeddeds>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>com.avionos.aem.cacheablerenditions</groupId>
        <artifactId>cacheable-renditions</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

Javadocs

https://javadoc.io/doc/com.avionos.aem.cacheablerenditions/cacheable-renditions/latest/index.html

Versioning

Follows Semantic Versioning guidelines.

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.