トップページ > 記事閲覧
.htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/11(Sat) 16:35
投稿者 FC
参照先
お世話になります.

gzip圧縮と,キャッシュを有効にするために,以下の様な記述を行った.htaccessをpublic_html直下にアップロードしました.

# gzip
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript

# cache
ExpiresActive on
ExpiresByType image/png "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"

しかし,500エラーが返ってきてしまいます.
こちらのサーバーでは対応していないのでしょうか?

ご回答よろしくお願いします.
Re: .htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/14(Tue) 20:15
投稿者 スタッフ◆N8w3Owi1UJk
参照先
FC様

ExpiresActiveならびにExpiresByTypeにつきましては、ご利用のサーバー名をご連絡いただきましたら、対応させていただきます。
VALUE-DOMAINユーザーコントロールパネルにログインいただいた状態で、お問い合わせフォームよりご連絡ください。
https://www.value-domain.com/support.php

但し、バリューサーバーのみの対応となり、また、再起動が必要なため、状況を追ってご連絡させていただくこととなりますことご寛容いただきますようお願いいたします。

他方、AddOutputFilterByType ディレクティブは、Apache 2.0.33 以降で使用可能ですが、2.1 以降で非推奨となりますので、
mod_filterをご利用いただき、FilterProviderで指定いただきますようお願いいたします。

http://httpd.apache.org/docs/2.2/mod/core.html
http://httpd.apache.org/docs/2.2/mod/mod_filter.html
Re: .htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/14(Tue) 23:50
投稿者 FC
参照先
回答ありがとうございます.

ExpiresActive,ExpiresByTypeについては当方Coreserverを利用させて頂いていますので,諦めることにします.
ですが,いずれはCoreserverでも利用できるようになることを希望します.

gzip圧縮につきまして,ご提示いただいたURLを参考に.htaccessに次の2パターンの記述を行ってみましたが,やはり500エラーが返ってきます.

パターン1(http://httpd.apache.org/docs/2.2/mod/mod_filter.htmlのコピペです)
-------------------------------------------------------
FilterDeclare gzip CONTENT_SET
FilterProvider gzip inflate req=Accept-Encoding !$gzip
FilterChain gzip
-------------------------------------------------------

パターン2
-------------------------------------------------------
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# ここからフィルター設定
FilterDeclare Compression CONTENT_SET
FilterProvider Compression DEFLATE Content-Type $text/plain
FilterProvider Compression DEFLATE Content-Type $text/css
FilterProvider Compression DEFLATE Content-Type $application/xhtml
FilterProvider Compression DEFLATE Content-Type $application/xml
FilterProvider Compression DEFLATE Content-Type $application/xhtml+xml
FilterProvider Compression DEFLATE Content-Type $application/rss+xml
FilterProvider Compression DEFLATE Content-Type $application/atom+xml
FilterProvider Compression DEFLATE Content-Type $application/x-javascript
FilterProvider Compression DEFLATE Content-Type $image/svg+xml
FilterProvider Compression DEFLATE Content-Type $text/html
FilterProvider Compression DEFLATE Content-Type $application/javascript
FilterChain Compression
# ここまでフィルター設定

# Don't append Vary heder for specific files
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|zip|lzh|exe)$ dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
Header append Vary Accept-Encoding env=!dont-vary
-------------------------------------------------------


もしかするとFilterDeclareが対応していないのでしょうか?
回答よろしくお願いします.
Re: .htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/16(Thu) 16:02
投稿者 スタッフ◆N8w3Owi1UJk
参照先
FC様

申し訳ございません。せっかくお試しいただきましたが、
Coreserverを利用いただいているとのことですと、
mod_filterにつきましても対応いたしておりません。

mod_expiresはApach 2.0以上、mod_filterはApach 2.15以上でご利用可能となります。
Coreserverにつきましても、Apach 2.Xへのアップデート予定ではございますが、
お急ぎの場合には、バリューサーバーでお試しいただきましたら幸甚に存じます。


CORESERVERのソフトウェア情報
https://www.value-domain.com/coreip.php

バリューサーバーのソフトウェア情報
https://www.value-domain.com/vsip.php?action=all
Re: .htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/16(Thu) 17:23
投稿者 FC
参照先
回答ありがとうございます。

現時点では対応していないということで了解しました。
できるだけ早くアップデートしていただけると幸いです。
Re: .htaccessによるgzip圧縮,キャッシュの設定について
投稿日 : 2014/01/21(Tue) 19:03
投稿者 スタッフ◆N8w3Owi1UJk
参照先
FC様

ご快諾いただき有難うございます。
CORESEVERへの対応は、2014年春頃を予定しております。ご期待ください。

サービス改善情報
http://help.value-domain.com/