Skip to content

When a slug is shared amongst a page and posts, all the posts might be cleared during partial purge #2698

@alfonso100

Description

@alfonso100

Describe the bug
When there is a page that shares a slug with posts, whenever a purge of this page happens, we're clearing all posts too.

To Reproduce
Steps to reproduce the behavior:

  1. Create a page named Blog, with slug /blog
  2. Modify permalinks structure to display posts under /blog/%postname%' like this: https://jmp.sh/BcDMGIE
  3. add some posts and preload the cache.
  4. the posts should be cached inside the /blog folder, something like /blog/postname/index-https.html folders, and the blog page should be cached at /blog/index-https.html
  5. Edit the Blog page, or a sibling page.
  6. The whole /blog folder will be deleted, including all the posts that are sharing the parent folder.

Expected behavior
The posts that are created under a shared page slug folder, should not be deleted when editing the page.

Screenshots
Page:
Screen Shot 2020-06-01 at 5 13 49 p  m

Permalinks settings, including the same slug of one of the pages:
Screen Shot 2020-06-01 at 3 56 15 p  m

Resulting cache folder Structure:
Screen Shot 2020-06-01 at 3 05 09 p  m

Additional context
This purge can be triggered when editing the page itself, or by editing a sibling page since it will be included in the array by get_adjacent_post

It seems pretty similar to this issue: #2549
The additional content looks pretty close to this one.

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort

Metadata

Metadata

Assignees

No one assigned

    Labels

    epics 🔥For large tasks or features, broken into smaller issues.module: cacheneeds: product cleanuppriority: mediumIssues which are important, but no one will go out of business.severity: moderateFeature isn't working as expected but has work around to get same valuetype: bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions