Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adv CSS/JS Agg Issue #256

Open
kybarg opened this issue Jul 26, 2016 · 3 comments
Open

Adv CSS/JS Agg Issue #256

kybarg opened this issue Jul 26, 2016 · 3 comments

Comments

@kybarg
Copy link

kybarg commented Jul 26, 2016

If someone has troubles with Adv CSS/JS Agg and in status report sees

The web servers configuration will need to be adjusted. The server should have responded with a 304, instead a 200 was returned.

So I've adjusted config replacing this in drupal.conf

    ## Advanced Aggregation module CSS
    ## support. http://drupal.org/project/advagg.
    location ^~ /sites/default/files/advagg_css/ {
        expires max;
        add_header ETag '';
        add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
        add_header Accept-Ranges '';

        location ~* /sites/default/files/advagg_css/css[_[:alnum:]]+\.css$ {
            access_log off;
            try_files $uri @drupal;
        }
    }

    ## Advanced Aggregation module JS
    ## support. http://drupal.org/project/advagg.
    location ^~ /sites/default/files/advagg_js/ {
        expires max;
        add_header ETag '';
        add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
        add_header Accept-Ranges '';

        location ~* /sites/default/files/advagg_js/js[_[:alnum:]]+\.js$ {
            access_log off;
            try_files $uri @drupal;
        }
    }

With this as it is suggested in official Advagg docs

    ###
    ### advagg_css and advagg_js support
    ###
    location ~* files/advagg_(?:css|js)/ {
      gzip_static on;
      access_log  off;
      expires     max;
      add_header  ETag "";
      add_header  Cache-Control "max-age=31449600, no-transform, public";
      try_files   $uri @drupal;
    }
@iryston
Copy link
Contributor

iryston commented Aug 3, 2016

@kybarg thanks!
I think it's because not all sites are configured to store files in /sites/default folder

@mustanggb
Copy link

Commenting out add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT'; worked for me.

@tdm4
Copy link

tdm4 commented Nov 20, 2017

Can confirm replacing the nginx config with code in comment 1 works. Just commenting out the Last-Modified header didn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants