• Resolved mathieu

    (@mathieu)


    Hi,

    I am not sure if it is supposed to be that way… But I don’t have an expire header on my aggregate files :

    ao_hashcode.css
    ao_hashcode.js

    However

    ao_single_hashcode.js does have an expire header. Both patterns have ETag.

    I guess the browser will not download it if it recognizes the ETag but Page Insights is bugging me about it and I am an algorithm pleaser yes-man.

    Is that a conflict in my installation or is it the intended behaviour? And if it is the intended behaviour, is there a way to change this?

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Not, it’s not intended behavior.

    Autoptimize does not add the expires-header by itself, but it does add an .htaccess file in wp-content/cache/autoptimize to gently ask webservers that honor .htaccess files (Apache first and foremost if it is configured to honor htaccess files) to add expires headers. That .htaccess code however does not make any distinction between the aggregated and the “single” files, so my guess is that AO’s .htaccess is not used (either not Apache or Apache configured not to use .htaccess) and that expires are added directly at webserver level OR at cloudflare level and that some (re-)configuration might be needed there?

    Thread Starter mathieu

    (@mathieu)

    Ah… found it. I introduced it when we fixed the fallback CSS in multisite on your Github (https://github.com/futtta/autoptimize/issues/376).

    I ended up using those NGINX rules to bypass the autoptimize_404_handler altogether.

    # Gerer les fichiers autoptimize qui existe pu
    location ~* /wp-content/fichiers/(.*)/js/pq_([a-z0-9]+)\.(js)$ {
       try_files $uri $uri/ /wp-content/fichiers/$blogid/js/pq_fallback.js;
    }
    

    It also bypasses the php cache handler… So I added “expires max;” and it works.

    # Gerer les fichiers autoptimize qui existe pu
    location ~* /wp-content/fichiers/(.*)/js/pq_([a-z0-9]+)\.(js)$ {
       try_files $uri $uri/ /wp-content/fichiers/$blogid/js/pq_fallback.js;
       expires max;
     }
    

    Thanks Frank ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    de rien ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I have no Expires: header on my aggregate files’ is closed to new replies.