-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial purge does not clear CPT archive when non-default cache files are used #4508
Comments
another scenario with WebP here #4617 |
There's no feedback from customers regarding this one. It's not going to be implemented in the near future. We're open to discuss and reopen the issue though. |
I am having the same problem and was advised to install an extra plugin from WP Rocket to solve the issue. Why can't you add it to the core of WP Rocket as others are experiencing the same problem? |
related https://secure.helpscout.net/conversation/2819097199/534966 |
Acceptance Criteria
|
Scope a solutionTo fix the mentioned issue, we could modify the if ( 'post' !== $post_type ) {
$post_type_archive = get_post_type_archive_link( $post_type );
if ( $post_type_archive ) {
// Define base filename and SSL suffix
$base_filename = 'index';
$ssl_suffix = is_ssl() ? '-https' : '';
$post_type_archive = trailingslashit( $post_type_archive );
// Define base cache variations
$filenames = [
"{$base_filename}{$ssl_suffix}.html",
"{$base_filename}{$ssl_suffix}.html_gzip",
"{$base_filename}-mobile{$ssl_suffix}.html",
"{$base_filename}-mobile{$ssl_suffix}.html_gzip",
"{$base_filename}{$ssl_suffix}-true.html",
"{$base_filename}{$ssl_suffix}-true.html_gzip",
$GLOBALS['wp_rewrite']->pagination_base
];
// Add full URLs to the purge array
$purge_urls = array_map(fn($file) => $post_type_archive . $file, $filenames);
}
} This will include the This goes to replace the current code here |
Checking that now... |
@Miraeld what happens when we add the following line:
directly after this line: wp-rocket/inc/common/purge.php Line 75 in 5b286ce
can u plz check if this would work or not? |
Umm, it seems to work, but, there is something I don't get. Is it expected @wordpressfan ? |
Yes this is normal, if you checked the woocommerce Settings > Products the setting of We use the function which is set here: you can read more about has_archive argument here: https://developer.wordpress.org/reference/functions/register_post_type/#parameters does this make sense? Thanks Boss. |
GroomingWe need to add the following line:
directly after this line: wp-rocket/inc/common/purge.php Line 75 in 5b286ce
Effort:[XS] |
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
Some Cached pages aren't cleared when editing post if Cookie GDPR is enabled
To Reproduce
Precondition:
Steps to reproduce the behavior:
https://rocketlabsqa.ovh/product/wordpress-pennant/
https://rocketlabsqa.ovh/shop/
https://rocketlabsqa.ovh/wp-admin/post.php?post=1000&action=edit
Expected behavior
All cached files are deleted
Screenshots

If applicable, add screenshots to help explain your problem.
Additional context
We're clearing only the .html and .html_gzip ending files of the Archive page
When there's a dynamic cookie we will not clear the cache of specific archive pages
The problem is here:
wp-rocket/inc/common/purge.php
Lines 72 to 73 in 9ba1546
purge.php
It also seems that the pagination clearing is broken there, it tries to clear this https://rocketlabsqa.ovh/shop/index-httpspage instead of this https://rocketlabsqa.ovh/shop/page/2/index-https.html
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: