memo.xight.org


2006-02-21 Tue

Apache2 で mod_deflate

- Summary
ネットワークの速度がボトルネックになっている場合には,
動的にコンテンツ圧縮を行うことでパフォーマンスを上げることが可能.
動的に圧縮を行うため,CPU等のリソースは通常の転送時以上に消費する.

Apache1.x では mod_gzip を用いたが,Apache2.x では mod_deflate を用いる.

- /etc/apache2/mods-available/deflate.conf を作成

# mod_deflate
<IfModule mod_deflate.c>
	AddEncoding x-compress Z
	AddEncoding x-gzip gz tgz
	DeflateCompressionLevel 9
	#AddOutputFilterByType DEFLATE text/html text/plain text/xml
	
	DeflateFilterNote Input instream
	DeflateFilterNote Output outstream
	DeflateFilterNote Ratio ratio
	LogFormat '%h %l %u %t "%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
	
	<Directory />
		# Filter
		SetOutputFilter DEFLATE
		# Netscape 4.x
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		# Netscape 4.06-4.08
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		# MSIE masquerades as Netscape, but it is fine
		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
		# Don't compress images and binary files
		SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
		SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
		SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z)$ no-gzip dont-vary
	</Directory>
</IfModule>


- /etc/apache/sites-enable/defalut
CustomLog /var/log/apache2/deflate.log deflate


- mod_deflate を有効化

# a2enmod deflate
# apache2ctl restart


- mod_deflate が有効になっているかどうかのチェック
w3m と gunzip を利用して簡単にチェックが可能.

% w3m -dump_source http://example.com/ | gunzip

カテゴリ: [Apache]

Ajax と OpenSearch と はてなダイアリーキーワード連想語 API を使ったはてな検索のデモ

- Reference
Ajax と OpenSearch と はてなダイアリーキーワード連想語 API を使ったはてな検索のデモ
http://pocari.org/tools/ajax/opensearch/

[戯] Ajax と OpenSearch と はてなダイアリーキーワード連想語 API を使ったはてな検索のデモ
http://cl.pocari.org/2006-02-20-1.html

カテゴリ: [Ajax][Stub]

AjaxFTP - PHP + Ajax で FTP

- Source

<?php
	require('ajaxftp/ajaxftp.php');
	$aj = new AJAXFTP;
	$aj->server = "ftp.example.com";
	$aj->baseurl = "http://localhost/ajaxftp";
	$aj->present();
?>


- Reference
SourceForge - AjaxFTP
http://sourceforge.net/projects/ajaxftp/

- via
phpspot開発日誌 - PHPとAjaxでFTP機能を実現するツールの紹介
http://phpspot.org/blog/archives/2006/02/phpajaxftp.html

カテゴリ: [Ajax][PHP][Stub]

アートワークを Perl で設定する方法

- Reference
NamingSense::TokuLog! - アートワークを Perl で設定する方法
http://d.hatena.ne.jp/tokuhirom/20060218/1140279373

カテゴリ: [iTunes][Perl][Stub]
2006-02 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Color Reference

ChangeLogを検索
携帯電話からアクセス!

カテゴリ

最近の話題

リンク

過去ログ

Google

QR Code

Since
2002-11-28
Update
2008-12-02 10:52
Copyright © 2005 xight.org All Rights Reserved.