2016-07-07 9 views
2

私は、Zendのフレームワークを使用して、私は私がcss.phpの有効期限ヘッダーを設定するにはどうすればよいこのcss.phpの有効期限ヘッダを設定するにはどうすればよいですか?

http://www.example.com/css.php?request=application%2Fthemes%2Flove%2Ftheme.css&c=2146&pageStart=15376&pageEnd=256358

のようにCSSファイルをたくさん持っていますか? 実際、私の.htaccessはそれで動作しません。

マイ.htacess:

<IfModule mod_expires.c> 
# Enable expirations 
ExpiresActive On 
# Default directive 
ExpiresDefault "access plus 1 month" 
# My favicon 
ExpiresByType image/x-icon "access plus 1 year” 
# Images 
ExpiresByType image/gif "access plus 1 month" 
ExpiresByType image/png "access plus 1 month" 
ExpiresByType image/jpg "access plus 1 month" 
ExpiresByType image/jpeg "access plus 1 month" 
# CSS 
ExpiresByType text/css "access 1 month” 
# Javascript 
ExpiresByType application/javascript "access plus 1 year" 
</IfModule> 

答えて

1

はどのようにあなたが何かを持ってチェックしている

<IfModule mod_headers.c> 
    <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$"> 
    Header set Cache-Control "max-age=2678400, public" 
    </filesmatch> 
    <filesmatch "\.(html|htm)$"> 
    Header set Cache-Control "max-age=7200, private, must-revalidate" 
    </filesmatch> 
    <filesmatch "\.(pdf)$"> 
    Header set Cache-Control "max-age=86400, public" 
    </filesmatch> 
    <filesmatch "\.(js)$"> 
    Header set Cache-Control "max-age=2678400, private" 
    </filesmatch> 
</IfModule> 
+0

私はあなたの.htaccessしか使用が – Rocstar

+0

を変更した.htaccessファイルに以下試してくださいありがとうキャッシング後に変更されましたか? :) – Sree

+0

はい私はPageSpeed Insights with Googleをチェックしています:) – Rocstar

関連する問題