codeburrow / company-web-app

The code for the official CodeBurrow app
http://www.codeburrow.com
MIT License
1 stars 0 forks source link

Feature/improve google page speed ranking #24

Closed rdok closed 8 years ago

rdok commented 8 years ago

According to Google Page Speed Insights we can reach at a 85% for mobile and 90% for desktop ranking.

Stage Server & Results

Please also read the updated readme file, on the possible updates we'll need to do on the web server.

1. Important note: Despite the above high ranking, that orange preloader when we load the page, still takes too long. It seems it actully makes the page to wait after we load all assets including the ones loaded asynchronously. This goes on the opposite direction of what googles tries to do with the above-the-fold rule. My suggestion would be to just disable this preloader component. With this pull request's optimization the load will quite fast. And there are still a few optimization we could.

2. Important note: You will need to copy/paste the .env.example and fill accordingly. Do this step before pulling the code into the production server.

This should close #16

PadawanTony commented 8 years ago

@rdok Great work! I will bookmark this issue to have it as a reference!

1) I agree. The orange preloader should go away.

2) I see that the README.md file contains instructions for nginx. Our server is running on apache however. Is this an issue?

rdok commented 8 years ago

@PadawanTony Ahh, sorry about not thinking that possibility. The code is not an issue. But we'll need relevant rules to add to the apache for the page speed ranking (I think it amounts to about 10%)

PadawanTony commented 8 years ago

@rdok OK. Change the README.md accordingly whenever you want.

PadawanTony commented 8 years ago

@rdok About the .env file, I have created the .env file with the right values on the production server. Should I pull the code now? Because we don't have the .env in the .gitignore. I'm not sure what the right sequence of steps is here.

PadawanTony commented 8 years ago

@rdok I think first I need to pull and then create the .env

rdok commented 8 years ago

@PadawanTony Both ways it will work, because we have appended the .env to the .gitignore.

And as long as the database is not used in the time you will need to do the update, there will not be a problem. For our case it's fine.

However, it's a good habit to make for the future. Where we want to take the app offline as little as possible (the time you need to add the environment). By firstly creating the .env file, and putting the relevant variables, we don't need to actually put the web app to maintenance mode at all :)

But, yeah for our specific use case, it's fine, whatever will get the job done.

PadawanTony commented 8 years ago

@rdok great I did it.

And now I have to upgrade php I guess -__-

 - phpunit/php-code-coverage 4.0.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
  Problem 2
rdok commented 8 years ago

@PadawanTony awesome!

Actually re-run composer:

composer install --no-dev // Install only production libraries.

I only added vlucas/phpdotenv production library which does not require a higher PHP version.

The reset of the development libraries, are not required by the production. As they are mostly tools, e.g. the phpunit/php-code-coverage you mention it's a tool measuring the testing coverage of the project. But there is no need for it to run on the production :)

Note: The above command is actually run on default on all heroku projects.

PadawanTony commented 8 years ago

I ended up updating to php7.