Skip to content

Add rev Parameter for image URLs for RELEASE APIs #221

@alexander-nikiforov-intentive

Description

Hi,

We are using CaaS Images behind the proxy to get Caching for images for 1 Year.

We have implemented this functionality because we saw at Preview that the FSXA-API adds rev Parameter,
that invalidates the Cache every time the image is updated.

Here is the example preview URL:

We have unfortunately noticed too late that Revision parameter for images in buildMediaUrl() (https://github.com/e-Spirit/javascript-content-api-library/blob/master/src/modules/CaaSMapper.ts#L226) is not added when using LIVE CaaS APIs

This way our Website Caching cannot be used.

Could you update the buildMediaUrl function so that one can add rev Parameter at LIVE APIs as well.

Something like this?

buildMediaUrl(url: string, rev?: number, fsxaConfig: Object) {
    if (rev && fsxaConfig.useRevisionParameterAtRelease === true) {
      url += `${url.includes('?') ? '&' : '?'}rev=${rev}`
    } else if (rev && this.api.contentMode === FSXAContentMode.PREVIEW) {
      url += `${url.includes('?') ? '&' : '?'}rev=${rev}`
    }
    return url
  }

It is very important feature for us, that currently does not allow us to use effective Caching when image is updated.

Reference to Support Ticket https://support.crownpeak.com/hc/en-us/requests/163337

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions