2

Chromium Dev Tools complain about all the resources being "explicitly non cacheable", although I'm explicitly adding the relevant directives in my config.

I have this file in /etc/nginx/sites-enabled/, which is included by the main config:

upstream django {
    server unix:///tmp/uwsgi.sock;
}


server {
    listen 80;
    charset utf-8;

    pagespeed on;
    pagespeed FileCachePath /var/ngx_pagespeed_cache;
    pagespeed ModifyCachingHeaders off;
    pagespeed RewriteLevel PassThrough;
    pagespeed EnableFilters collapse_whitespace;

    location /robots.txt {
        alias /home/user/www/staticfiles/robots.txt;
    }

    location /sitemap.xml {
        alias /home/user/www/staticfiles/sitemap.xml;
    }

    # Media: images, icons, video, audio, HTC
    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";
    }

    # CSS and Javascript
    location ~* .+\.(?:css|js)$ {
        expires max;
        #access_log off;
        add_header Cache-Control "public";
    }

    location ^~ /static/  {
        alias /home/user/www/staticfiles/;
    }

    location / {
        uwsgi_pass django;
        include uwsgi_params;
    }
}

Here are the headers:
Request

Accept:image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,fr;q=0.6,it;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Cookie:csrftoken=waqcxfsiBGAtD9OgVoKXnTxDHcfqiQFJ
Host:streaming-ita.co
Pragma:no-cache
Referer:http://streaming-ita.co/static/CACHE/css/1d69e50f86a3.css
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36

Response

Accept-Ranges:bytes
Connection:keep-alive
Content-Length:1015
Content-Type:image/png
Date:Tue, 01 Sep 2015 20:07:35 GMT
ETag:"55e21ced-3f7"
Last-Modified:Sat, 29 Aug 2015 20:58:21 GMT
Server:nginx/1.8.0

I see that a Pragma: no-cache and a Cache-Control: no-cache is present, but I didn't add it for sure. Is Chrome adding it?

4

0 回答 0