Trailingslash prevents WP Rest API from being cached #5900
Labels
effort: [XS]
< 1 day of estimated development time
module: cache
priority: medium
Issues which are important, but no one will go out of business.
severity: major
Feature is not working as expected and no work around available
type: bug
Indicates an unexpected problem or unintended behavior
Milestone
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
When using our helper plugin which allows caching WP Rest API and permalinks has trailing slash so this blocks the following url from being cached at all:
and to make it works we add the trailing slash for those RestAPI urls like:
the line that blocks it from being cached is:
wp-rocket/inc/classes/Buffer/class-cache.php
Lines 79 to 81 in 0300a74
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I think WP Rest API needs to be excluded from this bailout so it can be cached if this helper is used
Additional context
Slack discussion: https://wp-media.slack.com/archives/C43T1AYMQ/p1682629639240929
Through this discussion, @joejoe04 tried a good solution related to force redirect the urls from not trailingslash to the trailingslash one by using a helper plugin and this worked like a charm.
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: