2016-08-21 4 views
3

オンラインショップ(Shopware)をGooglePageSpeedで分析すると、すべての画像に「期限切れ指定なし」という多数の行が表示されます。Googleページスピードの解決方法:「有効期限指定なし」

enter image description here

ウェブサーバ(nginxのは)2番目の要求に期待304-応答で、その結果、すべての画像の応答にのLast-Modified -TimestampsとETAGヘッダを追加しますので、私は疑問を抱いています。

enter image description here

/GoogleのページスピードでサポートされていないETAG LASTMODIFIEDていますか?

私はnginxのコンフィギュレーションの適切な部分を提供します:

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { 
    expires 1M; 
    access_log off; 
    add_header Cache-Control "public"; 
} 

## All static files will be served directly. 
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|html|xml)$ { 
    ## Defining rewrite rules 
    rewrite files/documents/.* /engine last; 
    rewrite backend/media/(.*) /media/$1 last; 

    expires 1w; 
    add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 

    access_log off; 
    # The directive enables or disables messages in error_log about files not found on disk. 
    log_not_found off; 

    tcp_nodelay off; 
    ## Set the OS file cache. 
    open_file_cache max=3000 inactive=120s; 
    open_file_cache_valid 45s; 
    open_file_cache_min_uses 2; 
    open_file_cache_errors off; 

    ## Fallback to shopware 
    ## comment in if needed 
    #try_files $uri @shopware; 
} 

が間違っanythongまたは行方不明ですか?

+0

これまでにこの回答が見つかりましたか? – JCats

+1

vhost-configにもう1つのexpire-statementがあることがわかりました。問題を解決した単一の声明にそれらを減らす – itinance

答えて

1

最後に、vhost-configにexpire-statementがもう1つあることがわかりました。両方の問題を解決した単一のステートメントに減らす

関連する問題