CloudFlare
Settings that break streaming, and the ones that help
CloudFlare is a popular content delivery network (CDN) and security service that provides a range of features to enhance website performance and security. However, when your RKHM is installed on a domain proxied through CloudFlare, certain issues can arise:
- Real IP Address Not Passed: By default, CloudFlare masks the real IP addresses of users, passing CloudFlare IPs instead. This can break functionalities in your RKHM that rely on users' real IP addresses.
- Page and Endpoint Caching: CloudFlare can cache certain pages and endpoints, which may cause issues with dynamic content and functionality within your RKHM.
To address these issues, we have added official support for CloudFlare in version 2.0.59 of RKHM. This support ensures proper handling of IP addresses and caching, maintaining the intended functionality of your RKHM
Enabling CloudFlare Support
Follow the steps below to enable CloudFlare support in your CMS:
1. Locate the Configuration File: Navigate to the ~rkhm/api/app/ directory
2. Edit the User Configuration File: Open the user_config.php file in a text editor.
3. Modify the CloudFlare Cache Setting:
Find the line:
define( "cf_cache", false );
Change it to:
define( "cf_cache",
Save and Close the File
4. Clear CloudFlare Cache:
It may be beneficial to clear CloudFlare’s cache to ensure the new settings take immediate effect. This can be done through the CloudFlare dashboard by navigating to the Caching section and selecting the "Purge Everything" option.
Older versions
If you have installed an older version of RKHM ( latest version released on Codecanyon is 2.0.38 ), then you might need to temporarily disable the admin's IP lock so you can login and update to version 2.0.59 in which we added official support for CloudFlare. In order to do that, please locate config_user.php file ( explained above ) and find:
define( "admin_ip_lock", true );
And change it to:
define( "admin_ip_lock", false );
You can revert this change after updating to v2.0.59