Problem/Motivation

We are trying to purge only the home page so '/' and when we try that with the path option we get the error 'Exception while trying to invalidate the items: Path invalidations cannot start with slashes.'

Note that in CloudFront we can specific just '/' and that invalidates the home page correctly. Is there a way to do that with the module?

Entering "/" in the Purge Invalidation Form fails because purge core
rejects path expressions starting with a slash.

Steps to reproduce

Setup the module as per the documentation.

  1. Navigate to Configuration -> Development -> Performance
  2. Click 'Purge Invalidation Form'
  3. Select 'Type' of 'Path'
  4. Enter just / in the 'Item' textarea
  5. Click 'Purge'
  6. Confirm the error

Proposed resolution

Treat an empty
expression and the "" keyword as equivalent, both resolving to
the CloudFront invalidation path "/".

Remaining tasks

  1. Verify the bug and proposed solution.
  2. Add solution.
  3. Release new beta version

User interface changes

Potentially adding a new drop-down.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dmundra created an issue. See original summary.

dmundra’s picture

Title: Cannot purge '/' » Cannot purge the home page or '/'

Updating title.

dmundra’s picture

Issue summary: View changes

kim.pepper made their first commit to this issue’s fork.

kim.pepper’s picture

Issue summary: View changes
kim.pepper’s picture

Status: Active » Needs review
kim.pepper’s picture

@dmundra please test out the MR and let me know if it fixes the issue.

dmundra’s picture

Thank you @kim.pepper

Will try to review this soon.