Shared Hosting Deployment

I have successfully deployed my application on a shared hosting environment.

I was just wondering what files/folders were not strictly necessary in production and could be deleted? Are there any that absolutely should be removed especially from a security perspective?

Thank you.

Are you limited in storage space?

No, but looking to reduce if possible and certainly interested in any best practices especially for optimum security.

Thank you taking the time to answer so many of my questions!!!

Security won’t be improved by deleting parts of the framework.

You can dramatically reduce size by:

  1. Using --prefer-dist with composer when installing/updating framework.
  2. Using --no-dev not to install development dependencies such as Gii or Debug. You don’t need any of these in production.
  3. Check your composer.json, require section. If there’s anything you don’t use, remove it. For example, if you don’t send emails, remove swiftmailer.
1 Like

Thank you for the advice.