Category pages not cached when additions added to path
Describe the bug The general pattern of the issue is that a page like this one is cached: https://example.com/product-category/powerflex/
While ones like this are not cached: https://example.com/product-category/powerflex/filters/powerflex-car-model/alto-1987-2011/
This is in relation to the following WooCommerce Ajax Products Filter plugin (though I suppose it could happen with other plugins that do similar things with URL paths): https://berocket.com/woocommerce-ajax-products-filter/
When filters are applied to the first page above, the filter function works by adding the additional parts to the page's path, and we get the 2nd URL not cached.
Rocket Debug shows the following reasons:
Page not cached by filter.
Buffer content under 255 characters.
For additional context, we made this update some time ago to prevent caching for invalid taxomonies: https://github.com/wp-media/wp-rocket/pull/6984
However, it seems that change has caused some pages that are valid, like the one above, to not be cached.
Expected behavior The valid taxonomy pages should be cached while still not allowing invalid taxonomy pages to be cached.
Screenshots https://imagizer.imageshack.com/a/img923/6659/lbFRCE.png
Additional context
Ticket: https://secure.helpscout.net/conversation/2841718115/539402
Slack: https://wp-media.slack.com/archives/C07PZNW7BJ5/p1739203324588729?thread_ts=1739169608.110309&cid=C07PZNW7BJ5
Also had a related case here: https://secure.helpscout.net/conversation/2832222833/537596 In this case, the URLs were modified with Rewrite rules.
Had this kind of case here: https://secure.helpscout.net/conversation/2840308531/539144
Another case: https://secure.helpscout.net/conversation/2844780797/539991?viewId=2952229
We'll add a filter to disable this feature completely when needed.
Related: https://secure.helpscout.net/conversation/2849118004/540763
Related case here: https://secure.helpscout.net/conversation/2869929307/544812?viewId=8127831
related: https://secure.helpscout.net/conversation/3114455679/594133?viewId=7406897