2016-08-21 4 views
3

Анализ интернет-магазина (Shopware) с GooglePageSpeed приводит к тому, что многие «expiration not defined» -Лины на каждом изображении.Как решить Google Page Speed: «срок действия не указан»

enter image description here

мне интересно, потому, что веб-сервер (Nginx) добавляет Last-Modified -Timestamps и ETAG заголовки в ответ на все изображения, в результате чего ожидаемый 304-ответ на второй запрос ,

enter image description here

ли ETAG/LastModified не поддерживается Google Page Speed?

Я предоставлю соответствующие части 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 был еще один истекающий оператор. сократить их до одного заявления, решившего нашу проблему – itinance

ответ

1

Наконец-то мы выяснили, что в vhost-config был еще один истец-оператор. Сократите оба до одного заявления, решив наш выпуск.