• Resolved nunosaraiva91

    (@nunosaraiva91)


    Is there any way to save the plugin settings on database instead of the master.php file?

    I have multiple servers behind a loadbalancer and I always need to have this master.php file in each server. And when I need to change some setting on the backoffice it doesn’t work because it will only update the master.php on one server and not all of them.

    Any ideas on this?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nunosaraiva91

    Thank you for reaching out and I am happy to assist you with this.
    The answer is yes, but you should note that many types of requests can be made prior to the initialization of the database, so switching to a database-stored configuration will increase request response time. This functionality should be used only when you have no other option. To enable the database-stored setting, add define( 'W3TC_CONFIG_DATABASE', true ); to your wp-config.php and the plugin will immediately begin to use the options table for configuration storage via the wp-options table. Alternatively, the W3TC_CONFIG_DATABASE_TABLE constant can be defined to specify a table you created specifically for this use case.

    Note: If you customized your settings prior to switching to the database storage setting, you will lose your configuration settings. Be sure to export settings beforehand, then import afterward. You can then remove the configuration file from your source control if it was there and delete it. Ideally, defining the W3TC_CONFIG_DATABASE constant prior to plugin activation allows you to skip all of these steps.

    I hope this helps!

    Thanks!

    Thread Starter nunosaraiva91

    (@nunosaraiva91)

    That’s awesome! thank you very much.

    This will help me a lot!

    Cheers!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nunosaraiva91

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review?here. This will help us to continue offering a top-notch product to users.
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Save settings on Database’ is closed to new replies.