Understanding Environments
When developing stable, scalable websites, you'll want to use multiple environments as changes to your site progress through various stages.
While all sites are different, the overwhelming majority of WordPress sites will utilize three different environment types - development, staging, and production.
Development Environments
Development environments are used for untested code and in-progress changes. They will typically exist on the developer's local machine, but can sometimes also live in a remote location.
- In general, development environments will contain the following configurations:
- Caching disabled.
- CDN disabled.
- Logging and error display enabled.
- Debugging (XDebug) enabled.
Staging Environments
Staging environments are used to test code that has been in development recently. After you've made changes within your development environment and are satisfied with them, you'll push the changes to your staging environment to make sure everything is still running smoothly.
Overall, your staging environment should match your production environment as much as possible, while still revealing any errors that might be present. Your configuration should look something like this:
- Caches purged and rebuilt after deploying changes.
- CDN purged and rebuilt after deploying changes.
- Logging and error display enabled.
We recommend that you always utilize a current staging environment before making any changes to your production site. Using a staging environment ensures that if there's an issue, you can immediately find it before your website goes live in production.
Production Environments
Your production environment is where your site lives for the world to see. Because this environment requires stability, security, and speed, we recommend that you only push well-tested changes through to production. You'll also want to use the following configuration settings:
- Caching enabled.
- CDN enabled.
- Error display disabled.
- Debugging disabled.