Yii Framework Forum: Reducing size of Yii template app - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Reducing size of Yii template app Rate Topic: -----

#1 User is offline   rackycz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 16-December 09

Posted 10 December 2017 - 02:41 AM

Hi all

I was uploading my new Yii2 application and was surprised that it took 20minutes. So I checked the app-folder and found out that the Basic application has cca 6300 files and cca 65MB. See attachment (img created using Space Monger)

  • Is there a way how to reduce the size?
  • It would be nice if the debug-mode had a tool that would analyze used modules and would suggest folders that can be deleted.


I believe that answer could be added to tutorial:
http://www.yiiframew...nce-tuning.html

Thanks for ideas.

Attached File(s)


0

#2 User is offline   alrazi 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,546
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 10 December 2017 - 03:05 AM

run composer install with a flag --no-dev to skip the development dependencies when deploying, read more about composer to understand it. It will reduce your app size
0

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 13 December 2017 - 07:19 AM

If you have ssh/cmd-line access to your server, you usually don't copy 'vendor'. You just run composer :)
There, you can use the --no-dev flag.
Also, a good idea to use --optimize-autoloader too!
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users