WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
How to retain settings across git deployments (6 posts)

  1. danblaker
    Member
    Posted 2 years ago #

    I use PHPFog to host my WordPress sites, but this issue is also relevant on other hosts. I develop locally, then I use the Git version control system to deploy my changes to PHPFog. When I push to my remote repo, the Git client on my webserver automatically pulls the latest files.

    This works great for many things, but W3 Total Cache is not one of them. Every time I deploy changes to the server, I lose my W3 Total Cache settings. I can't include my settings in the code repository, because my local configuration is different from my server config (e.g., no APC Opcode Cache installed locally). But of course, if I put the W3TC files in my .gitignore file so they aren't deployed, then they are blown away on the server.

    What approach do you recommend for deploying via Git or via VCS scripts like Capistrano or Vlad the Deployer?

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Can you deactivate W3TC locally, yet keep the production settings in the repo? That should work fine.

  3. SachaG
    Member
    Posted 1 year ago #

    Thanks, that worked for me.

    But before that I tried simply adding w3-total-cache-config.php and w3-total-cache-config-preview.php to .gitignore and that didn't seem to do anything, my settings were still getting over-written. Any idea why?

  4. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    If the files were not in your repo, I'm not sure how things could be overridden since they have to be edited on the file system or via the UI. Can you provide further detail?

  5. SachaG
    Member
    Posted 1 year ago #

    Actually the answer to my last question was that adding something to .gitignore doesn't work retroactively. If your files were already in the repo, it doesn't remove them.

    What would actually be really useful would be a list of the W3TC files that should be added to .gitignore, as well as a list of the files that need to be writable by the server.

    Or even better a "making W3TC work with PHPFog" guide! (one can always dream…)

  6. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    The w3tc/* directory in addition to the settings and preview file need to be writeable by the server.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic