lando / wordpress

The Official WordPress Lando Plugin
https://docs.lando.dev/wordpress/
GNU General Public License v3.0
13 stars 6 forks source link

Which WordPress files and folders can safley be excluded when optimizing Lando performance? #2

Closed BenJackGill closed 2 years ago

BenJackGill commented 2 years ago

The Lando docs say we can exclude files and folders from Docker to speed things up.

So far I have excluded three folders in my .lando.yml file, like so:

name: my-blog
recipe: wordpress
config:
  webroot: .
excludes: 
  - wp-admin
  - wp-content
  - wp-includes

This has made the WordPress admin and front end considerablly faster on my local machine.

But then I tried to squeeze out every last bit of performance by excluding the entire root wordpress/ directory, like so:

name: my-blog
recipe: wordpress
config:
  webroot: .
excludes: 
  - .

When doing this I ran into issues where changes on the site (such as edits to pages etc) were not being saved.

With that in mind I have three closley related questions:

  1. Why I can exclude those three folders mentioned above but not the root directory?
  2. What are the potential draw backs of excluding even those three folders I mentioned above?
  3. What are the exact WordPress files and folders that are considered safe for exlcuding this way?
labboy0276 commented 2 years ago

Hi @BenJackGill

I am not sure if you read the performance doc on the excludes, but here it is if you haven't. It explains in detail why to excluded folders and the drawbacks you are looking for.

My typical excludes list included directories that I would never touch in the code base. So, I could safely exclude them with no issues:

  - wp-admin
  - wp-includes
  - wp-content/cache/
  - wp-content/uploads/
  - wp-content/mu-plugins/
  - wp-content/themes/ANYTHEME_WP_THEME/

The reason why I think your excludes all failed is due to nothing getting bound to the host containers. I am sure there is a specific reason, but off hand I do not know.