Setup a http/2.0 web server via nginx

nginx now supports http/2.0
My blog is now http2.0 enabled!

nginx supports http/2.0 since version 1.9.5, if you have your own ssl cert for your own domain, you can now easily setup a http/2.0 enabled web server via nginx!

I’ll use Ubuntu 14.04 LTS as an example here, and assume you already have a https enabled site via old versions of nginx.

Add nginx mainline repository from

$ sudo sh -c ‘echo deb `lsb_release -cs` nginx > /etc/apt/sources.list.d/nginx_mainline.list’

Add PGP key for apt:

$ curl | sudo apt-key add –

Update apt repository local cache:

$ sudo apt-get update

Remove old nginx(remember to backup your configs!):

$ sudo apt-get remove nginx nginx-extra nginx-common


nginx now supports http/2.0

From this commit: 257b51c37c5a: The HTTP/2 implementation

The HTTP/2 implementation (RFC 7240, 7241). The SPDY support is removed, as it’s incompatible with the new module.

nginx http/2.0 support has been implemented since 12 days ago, and the SPDY support was removed, the new version came after, nginx v1.9.5 was tagged since 39 hours ago, we can now download it from its download page, and there are also linux pre-built packages:

For more info about http 2.0, see the links below:

Use ‘optipng’ to optimize/re-compress your png images losslessly!

OptiPNG is a useful tool to compress png images without loss its quality, it really help reduce the bandwidth, diskspace and the loading/response time for website. I used it to re-compress all the png images on cdnjs and successfully made 206857 images smaller(see cdnjs/cdnjs@e936c87e9044fd2b123).

It’s easy to use, you can install it via apt-get, or download and build it from source :
$ sudo apt-get install optipng

$ optipng example.png

The default compress level is 2, the range is 0~7 (may depends on the version you are using), I will always use the highest and slowest level:
$ optipng -o7 example.png

Find all the png images to compress:
$ find path -name "*.png" -exec optipng -o7 {} \;

In fact, optipng can convert BMP, GIF, PNM and TIFF format image to optimized optimized png, and also performs PNG integrity checks and corrections, very nice.

Firefox 的 Web Developer’s Toolbox


Web Developer’s Toolbox :: 收藏集 :: Firefox 附加元件 (

整理了一些網站開發人員常用到的瀏覽器套件,如Firebug、Greasemonkey、User Agent Switche、YSlow等


Firefox-WebDeveloper's Toolbox