You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a feature to exclude caching based on the value of the HTTP_REFERER header, similar to the existing functionality for cookie-based cache exclusion. This would allow users to define rules that bypass caching for requests originating from specific referers.
Use Case
Some users may want to exclude caching for certain pages or actions based on the referer. For example:
Dynamic content that should not be cached when accessed from specific sources.
Improved control over caching for scenarios involving redirections or traffic from external links.
Proposed Implementation
Add a new setting under the Advanced Options section in the Powered Cache settings.
Allow users to specify one or more referers (using strings or regular expressions).
Modify the cache logic to check the HTTP_REFERER value and exclude caching if it matches any of the defined referers.
Example Configuration
User inputs:
Referer: example.com
Referer Regex: ^https://partner\.example\.com
Cache exclusion logic:
Skip serving a cached page if $_SERVER['HTTP_REFERER'] matches any of the defined referer rules.
Benefits
Adds flexibility for users to manage caching behavior for specific scenarios.
Simplifies user workflows by eliminating the need for custom workarounds like cookies.
Expands the functionality of Powered Cache, making it more robust and versatile.
Additional Notes
Ensure backward compatibility with existing features.
Include clear documentation and examples in the plugin settings UI and support materials.
Provide a detailed changelog entry if implemented.
Activity
Igor-Yworld commentedon Jan 6, 2025
This will be a unique feature. It will help filter malicious traffic from parsers and scanners...
Add cache exclusions for specific referrers #150
mustafauysal commentedon May 28, 2025
added in 3.6, closing this now.