Re: [ngx-pagespeed-discuss] ngx_pagespeed issue with single css file

48 views
Skip to first unread message

Otto van der Schaaf

unread,
Jan 25, 2017, 6:15:16 PM1/25/17
to ngx-pagespeed-discuss
The css file you point out responds with the following headers (amongst others):

Cache-Control:max-age=2592000
Date:Wed, 25 Jan 2017 22:53:00 GMT
Expires:Fri, 24 Feb 2017 22:53:00 GMT

I am not sure, but maybe the conflicting expires/cache-control directives have something to do with the behavior you observe.
Could you try if serving the file with a future expiry resolves the issue?

Otto


On Wed, Jan 25, 2017 at 11:12 PM Jag Dhaliwal <goo...@jeanscene.co.uk> wrote:

i would be grateful if someone could help me resolve an issue i have with ngx_pagespeed. 


I have a styles.css file for my website which is minified using the prioritize_critical_css filter can see its done as page speed insights reports success and also when i view-source:https://www.jeanscene.tk/ i can see the code has been updated. 


After a page refresh (5 minutes) the styles.css file appears again as not minified and ngx_pagespeed beings the process of minifying it again, this process is repeated over and over again. This issue does not effect any other .css file on the page just this one.


https://www.jeanscene.tk/skin/frontend/default/jeanscene/css/styles.css


I have spent several days searching through forums but could not find a solution as to why only this file is effected. 



--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Jag Dhaliwal

unread,
Jan 26, 2017, 12:32:43 PM1/26/17
to ngx-pagespeed-discuss
Thanks Otto, I will try this and update here later. 
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Message has been deleted

Otto van der Schaaf

unread,
Jan 30, 2017, 4:38:02 AM1/30/17
to ngx-pagespeed-discuss
Thanks for trying that. 

I think ngx_pagespeed will retry to optimize that image every 5 minutes, which I think may temporarily affect the optimization status of the css file that links to it.

What happens when you correct the 404 by removing the reference or uploading the image?

Otto



On Sun, Jan 29, 2017 at 9:55 AM Jag Dhaliwal <goo...@jeanscene.co.uk> wrote:
Hi Otto,

Sadly this issue still remains for this css file, i have served all files with a future expiry date which now show:

Cache-Control:max-age=31536000
Date: Sat, 28 Jan 2017 23:17:14 GMT
Expires: Sun, 28 Jan 2018 23:17:14 GMT

The optimised version for /skin/frontend/default/jeanscene/css/styles.css will still expire after 300 seconds, on refresh another optimised file is created this process is repeated over and over again.

Pagespeed in now running on the site, please can you take another look. My configuration is:

    pagespeed on;

    pagespeed StatisticsPath /ngx_pagespeed_statistics;
    #pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
    pagespeed MessagesPath /ngx_pagespeed_message;
    pagespeed ConsolePath /pagespeed_console;
    pagespeed AdminPath /pagespeed_admin;
    #pagespeed GlobalAdminPath /pagespeed_global_admin;

    pagespeed FileCachePath /var/ngx_pagespeed_cache;

    pagespeed MemcachedThreads 1;
    pagespeed MemcachedServers "localhost:11211";
    pagespeed MemcachedTimeoutUs 100000;


    pagespeed LoadFromFile "^https?://jeanscene.tk/~([^/]*)"
                            "/home/jeanscene/html/";

    pagespeed Disallow "*index.php/arjan/*";                     

    pagespeed RewriteLevel PassThrough;

    pagespeed EnableFilters prioritize_critical_css;
    pagespeed EnableFilters fallback_rewrite_css_urls;

    pagespeed EnableFilters defer_javascript;
    pagespeed EnableFilters rewrite_javascript;

    pagespeed EnableFilters rewrite_images;
    pagespeed EnableFilters recompress_images;
    pagespeed EnableFilters recompress_jpeg; 
    pagespeed EnableFilters recompress_png;
    pagespeed EnableFilters recompress_webp; 
    pagespeed EnableFilters convert_gif_to_png; 
    pagespeed EnableFilters convert_jpeg_to_webp; 
    pagespeed EnableFilters convert_png_to_jpeg;
    pagespeed EnableFilters rewrite_css,sprite_images;
    pagespeed RetainComment " google_ad_section*";
    pagespeed EnableFilters make_show_ads_async;
    pagespeed EnableFilters make_google_analytics_async;

    pagespeed RewriteRandomDropPercentage 0;
    pagespeed EnableFilters combine_heads;                 
  
    location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
    add_header "" "";
    }
    location ~ "^/pagespeed_static/" { }
    location ~ "^/ngx_pagespeed_beacon$" { }
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

Jag Dhaliwal

unread,
Jan 30, 2017, 6:01:05 AM1/30/17
to ngx-pagespeed-discuss
Hi Otto,

Success :) i commented the link to that image from styles.css and now the optimised css no longer expires. Many thanks.

Kind Regards
Jag
Reply all
Reply to author
Forward
0 new messages