Apache や Nginx での帯域幅の最適化について
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
2014年9月5日金曜日
本記事でご紹介するデベロッパー サイトは、現時点ではまだ日本語に翻訳されていませんが、日本のみなさまにもご利用いただける内容であり、有益であると思いますのでご紹介させていただきます。
誰もが帯域幅の使用量を削減したいと考えています。ホスティング プロバイダーは料金を節約したいと考えていますし、モバイル ユーザーは使用制限の範囲内に収めたいと思っています。そして、不必要なバイト数の読み込みを待ちたいと思っている人は誰もいません。ウェブには帯域幅を節約できるチャンスがたくさんあります。たとえば、gzip せずに提供されているページ、縮小化されていないスタイルシートや JavaScript、最適化されていない画像などです。
では、なぜウェブは帯域幅用に最適化されていないのでしょうか。このような節約が誰にとっても有益なら、なぜ誰も実行しないのでしょうか。ほとんどの場合、こういった変更は大変面倒な作業だからです。ウェブ デザイナーはアートワークをエクスポートする際に「ウェブ用に保存」することが奨励されていますが、いつも忘れてしまいます。JavaScript プログラマーは、デバッグが困難になるからという理由でコードの縮小化を好みません。開発や展開のプロセスの一環として、これらの最適化がそれぞれサイトに毎回適用されるようにするカスタム パイプラインを設定することもできますが、大変手間がかかります。
ウェブ ユーザーにとっての簡単な解決策は、
Chrome
のようにデータを自動的に最適化し、圧縮してくれるプロキシを使用することです。ユーザーがこのサービスを使用すると、HTTP トラフィックが Google のプロキシ経由となり、ページの読み込みが最適化され、帯域幅の使用も 50% 削減されます。これは有益な方法ではありますが、この機能をオンにしている Chrome ユーザーのみに限定されます。また HTTPS トラフィックを最適化することはできません。
PageSpeed チームは、
帯域幅の最適化
機能によってウェブマスターの皆様に同様のテクノロジを提供いたします。これにより、他のブラウザのユーザー、安全なサイト、デスクトップ ユーザーに加え、アウトバウンド トラフィックの料金を低く抑えたいサイト所有者も、最適化を実現できるようになりました。
PageSpeed モジュール
を Apache または Nginx サーバーにインストールし [1]、設定で帯域幅の最適化機能を
有効にすれば
、後は PageSpeed がすべて解決してくれます。
キャッシュの拡張
、
インライン化
から、より積極的な機能である
画像の遅延読み込み
、
JavaScript の遅延実行
まで、PageSpeed の高度な最適化機能は、後からでも PageSpeed 設定で有効にするだけで使用できます。
詳しくは、
PageSpeed のインストール方法
や
帯域幅の最適化を有効にする方法
のページをご覧ください。
Posted by Jeff Kaufman, Make the Web Fast
Original version:
Official Google Webmaster Central Blog: Optimizing for Bandwidth on Apache and Nginx
[1] 別のウェブサーバーをお使いの場合は、Apache または Nginx プロキシでの PageSpeed の実行をご検討ください。このモジュールは完全な
オープンソース
であり、現在は
IIS
(英語)、
ATS
(英語)などへの移植が進行中です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2014-09-01 UTC。
[null,null,["最終更新日 2014-09-01 UTC。"],[[["\u003cp\u003eThe PageSpeed optimization tool helps reduce bandwidth usage by automatically optimizing website elements like images, stylesheets, and JavaScript files.\u003c/p\u003e\n"],["\u003cp\u003ePageSpeed offers an "Optimize for Bandwidth" feature, similar to Chrome's data compression proxy, to reduce bandwidth for all users, including those on different browsers and secure sites.\u003c/p\u003e\n"],["\u003cp\u003eWebsite owners can easily install the PageSpeed module on their Apache or Nginx servers and enable the "Optimize for Bandwidth" feature to benefit from these optimizations.\u003c/p\u003e\n"],["\u003cp\u003eBeyond basic bandwidth optimization, PageSpeed offers advanced features such as cache extension, inlining, image lazyloading, and deferred JavaScript execution, which can be enabled as needed.\u003c/p\u003e\n"],["\u003cp\u003ePageSpeed is open source and available for various web servers, with ongoing efforts to support even more platforms.\u003c/p\u003e\n"]]],["Webmasters can reduce bandwidth usage for all users by installing the PageSpeed module on their Apache or Nginx server. This module, with the \"Optimize for Bandwidth\" feature enabled, automatically optimizes pages, similar to Chrome's optimizing proxy. This solution benefits all browsers, secure sites, and desktop users, reducing outbound traffic. The module can be configured for more advanced optimizations like cache extension, inlining, lazyloading, and deferring JavaScript. PageSpeed is also open-source, and porting efforts are underway for other web servers.\n"],null,["# Optimizing for Bandwidth on Apache and Nginx\n\nThursday, September 04, 2014\n\n\nEveryone wants to use less bandwidth: hosts want lower bills, mobile users want to stay under\ntheir limits, and no one wants to wait for unnecessary bytes. The web is full of opportunities to\nsave bandwidth: pages served without gzip, stylesheets and JavaScript served unminified, and\nunoptimized images, just to name a few.\n\n\nSo why isn't the web already optimized for bandwidth? If these savings are good for everyone then\nwhy haven't they been fixed yet? Mostly it's just been too much hassle. Web designers are\nencouraged to \"save for web\" when exporting their artwork, but they don't always remember.\nJavaScript programmers don't like working with minified code because it makes debugging harder.\nYou can set up a custom pipeline that makes sure each of these optimizations is applied to your\nsite every time as part of your development or deployment process, but that's a lot of work.\n\n\nAn easy solution for web users is to use an optimizing proxy, like\n[Chrome's](https://developer.chrome.com/multidevice/data-compression).\nWhen users opt into this service their HTTP traffic goes via Google's proxy, which optimizes their\npage loads and cuts bandwidth usage by 50%. While this is great for these users, it's limited to\npeople using Chrome who turn the feature on and it can't optimize HTTPS traffic.\n\n\nWith\n[Optimize for Bandwidth](/speed/pagespeed/module/optimize-for-bandwidth),\nthe PageSpeed team is bringing this same technology to webmasters so that everyone can benefit:\nusers of other browsers, secure sites, desktop users, and site owners who want to bring down their\noutbound traffic bills. Just install the\n[PageSpeed module](/speed/pagespeed/module)\non your Apache or Nginx server^[1](#1)^,\n[turn on](/speed/pagespeed/module/optimize-for-bandwidth)\nOptimize for Bandwidth in your configuration, and PageSpeed will do the rest.\n\n\nIf you later decide you're interested in PageSpeed's more advanced optimizations, from\n[cache extension](/speed/pagespeed/module/filter-cache-extend)\nand\n[inlining](/speed/pagespeed/module/filter-js-inline)\nto the more aggressive\n[image lazyloading](/speed/pagespeed/module/filter-lazyload-images)\nand\n[defer JavaScript](/speed/pagespeed/module/filter-js-defer),\nit's just a matter of enabling them in your PageSpeed configuration.\n\n\nLearn more about\n[installing PageSpeed](/speed/pagespeed/module) or\n[enabling Optimize for Bandwidth](/speed/pagespeed/module/optimize-for-bandwidth).\n\nPosted by Jeff Kaufman, Make the Web Fast\n\n\n1: If you're using a different web server, consider running PageSpeed on an\nApache or Nginx proxy. And it's all\n[open source](https://github.com/apache/incubator-pagespeed-mod),\nwith porting efforts underway for\n[IIS](https://www.iispeed.com/),\n[ATS](https://www.atspagespeed.com/), and others."]]