rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.9k stars 12.52k forks source link

Web site should be transferring data compressed #12597

Closed huonw closed 10 years ago

huonw commented 10 years ago

Our search doc indexes are huge JS files, which are very amenable to compression.

We're failing pagespeed because of it: http://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fstatic.rust-lang.org%2Fdoc%2Fmaster%2Fstd%2Findex.html

lifthrasiir commented 10 years ago

Some quick comparison:

$ curl -s http://static.rust-lang.org/doc/master/std/search-index.js | wc -c
501867
$ curl -s http://static.rust-lang.org/doc/master/std/search-index.js | gzip -c -9 - | wc -c
84310

We can also consider adjusting the index format to exploit deflate/LZ77 algorithms if we want to optimize that further. (Unlikely, but just a possibility)

huonw commented 10 years ago

It appears that gzipping manually may be the only way to do this: http://stackoverflow.com/a/5447158/1256624

:(

thestinger commented 10 years ago

http://www.nomitor.com/blog/2010/11/10/gzip-support-for-amazon-web-services-cloudfront/ is linked there with a sane workaround

ehsanul commented 10 years ago

Doesn't seem like rust-lang.org is using cloudfront, but rather just hosts on S3? In which case, that may not work.

The best solution might be the answer further down, since it won't break on safari and mobile browsers and such.

alexcrichton commented 10 years ago

Closing, this is now done through the new official domain, http://doc.rust-lang.org/