Purge / Purge UI integration

Created on 22 December 2021, over 2 years ago
Updated 9 May 2024, about 2 months ago

Problem/Motivation

It looks like this module relies entirely on Drupal cache tags to handle its purging, which means there is no way to purge a file from the cache (in our case we do this often for PDFs), and if there is a problem with Drupal's cache tags, we have no way to purge a stale page from cache either.

We've found many instances of Drupal's cache tags being incorrect, and have needed to purge pages from the cache in other ways. Our pre-pantheon solution was to use Purge module, with a Purge UI that allowed site admins to enter in a URL to purge that single page from cache.

The only other alternative was to purge the whole cache at once (something we would very much like to avoid, especially now that our cache is also via CDN).

Proposed resolution

Has integration with the Purge module been considered?
It seems like there could be duplicaton of events if both modules are attempting to purge a page on node->save (for example)

If Purge integration is impractical, perhaps we could add a Purge UI feature directly to this module.
This would be less ideal as it would not benefit from any other feature that already exists for Purge module, but it would at least make the situation workable for those of us on Pantheon.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jenlampton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States capellic Austin, Texas

    I'd like to see an interface option for dealing with this use case.

    BTW, if anybody is looking for a way to do this via Terminus, this will work:

    terminus remote:drush SITE.ENV php:eval "pantheon_clear_edge_paths(['path/to/file/filename.pdf']);"

  • πŸ‡ΊπŸ‡ΈUnited States darby3

    FWIW the terminus command above appears to work for me (thanks, capellic!), while doing a curl request a la curl https://url.url/path/to/file.txt?parameter=unique does not. (I get a page not found error, using the latter, which makes sense, but the original file url minus the parameter piece appears to remain cached in the CDN.) Unless I'm formatting the curl request wrong?..

  • πŸ‡ΊπŸ‡ΈUnited States nsciacca Connecticut

    FYI - I did something similar in another ticket (3337669) for files that worked nicely using their pantheon_clear_edge_paths function and passing it the file url when the file was updated. In conjunction with the Media Entity File Replace module it seems to work well.

    https://www.drupal.org/project/pantheon_advanced_page_cache/issues/3337669 πŸ› Not showing newly updated/changed file on Pantheon - Cache issue Needs review

    https://git.drupalcode.org/project/pantheon_advanced_page_cache/-/merge_...

  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    I posted an update in the GitHub issue pointing to the other issue. I think it's still worthwhile to integrate with Purge, as that's the framework for accomplishing cache purges.

    I do see some sparse documentation for the pantheon_clear_edge_paths() function here https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache... and in Pantheon's equivalent WordPress plugin https://github.com/pantheon-systems/pantheon-advanced-page-cache/blob/re... I would prefer using that then doing full CDN clears for obvious reasons.

    I'm asking if someone from Pantheon can clarify the status of that function for general use, and also confirm the workflow for contributing to this module, since my GitHub pull request hasn't received any attention for two years, while the GitLab PR in the previously mentioned issue appeared to be merged within a month of being posted. While you are updating that paragraph on the module page, the Pantheon slack also recently consolidated slack channels into their single General channel, no more "Power Users" channel.

Production build 0.69.0 2024