So one of my old colleague was trying to find some quick way of increasing performance for his pet project website so he asked me to take a look. First thing I did was ran pagespeed and immediately I saw compression was off, css/js was not aggregated. JS/CSS aggregation would require either build changes or installing pagespeed so I thought quick 1 hour fix would be to just enable compression so I went and enabled " gzip on;" in nginx conf and it gave a good bump on login page but the home page after login, it kept complaining about JS/CSS not being compressed. I was scratching my head and left it as is that day.
Yesterday night finally I found out that turning gzip on would only compress text/html by default in nginx. You need to explicity turn it on for other types. So I went and added the below and problem was solved.
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/javascript application/json;
While doing this I also installed pagespeed with nginx. It was not as fun as installing it in apache because for nginx if you have to add module you need to recompile it from source. But it was worth it. The pagespeed score that was 60 went up to 90.
I really like products that removes human touchpoints, Pagespeed is one of them, Thanks to Google for creating this awesome product. At my employer's website before pagespeed I had to hunt developers every release to see if they had added proper version tags, they had followed build time aggregation guidelines and due to our release velocity, this was the first thing that was sacrificed and debt would keep piling up release after release. One day some customer would complain and everyone would scramble to get it fixed in one week. But thanks to pagespeed no more of this shit.
Yesterday night finally I found out that turning gzip on would only compress text/html by default in nginx. You need to explicity turn it on for other types. So I went and added the below and problem was solved.
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/javascript application/json;
While doing this I also installed pagespeed with nginx. It was not as fun as installing it in apache because for nginx if you have to add module you need to recompile it from source. But it was worth it. The pagespeed score that was 60 went up to 90.
I really like products that removes human touchpoints, Pagespeed is one of them, Thanks to Google for creating this awesome product. At my employer's website before pagespeed I had to hunt developers every release to see if they had added proper version tags, they had followed build time aggregation guidelines and due to our release velocity, this was the first thing that was sacrificed and debt would keep piling up release after release. One day some customer would complain and everyone would scramble to get it fixed in one week. But thanks to pagespeed no more of this shit.
Comments
Post a Comment