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 nginx.org:

[bash]
$ sudo sh -c ‘echo deb http://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx > /etc/apt/sources.list.d/nginx_mainline.list’
[/bash]

Add PGP key for apt:

[bash]
$ curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add –
[/bash]

Update apt repository local cache:

[bash]
$ sudo apt-get update
[/bash]

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

[bash]
$ sudo apt-get remove nginx nginx-extra nginx-common
[/bash]

閱讀全文

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: http://nginx.org/en/linux_packages.html

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

Usage:
$ 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

MozillaFirefox附加元件裡面的一個集合,

Web Developer’s Toolbox :: 收藏集 :: Firefox 附加元件 (https://addons.mozilla.org/zh-TW/firefox/collections/mozilla/webdeveloper/)

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

有些工具目前還沒用過,看來可以參考看看,有在開發網站或寫網頁的人也可以參考

Firefox-WebDeveloper's Toolbox