Join the community today
Register Now

PageSpeed This forum's pagespeed.conf

Discussion in 'Web Development & Web Performance' started by eva2000, May 26, 2014.

  1. Amin Sabet

    Amin Sabet Member

    49
    7
    8
    Nov 8, 2015
    Ratings:
    +14
    Local Time:
    9:44 PM
    Thanks, that's what I had (y):

    Code:
    pagespeed Domain https://www.mu-43.com;
    pagespeed Domain https://www.talkemount.com;
    pagespeed Domain https://www.fujixspot.com;
    pagespeed Domain https://www.leicaplace.com;
    pagespeed Domain https://www.photographerslounge.org;
    pagespeed Domain https://www.foreverfilm.org;
    
    pagespeed Domain https://mu43-236e.kxcdn.com;
    pagespeed Domain https://talkemount-236e.kxcdn.com;
    pagespeed Domain https://fujixspot-236e.kxcdn.com;
    pagespeed Domain https://leicaplace-236e.kxcdn.com;
    pagespeed Domain https://photolounge-236e.kxcdn.com;
    pagespeed Domain https://foreverfilm-236e.kxcdn.com;
    
    pagespeed LoadFromFile https://www.mu-43.com /home/nginx/domains/mu-43.com/public;
    pagespeed LoadFromFile https://www.talkemount.com /home/nginx/domains/talkemount.com/public;
    pagespeed LoadFromFile https://www.fujixspot.com /home/nginx/domains/fujixspot.com/public;
    pagespeed LoadFromFile https://www.leicaplace.com /home/nginx/domains/leicaplace.com/public;
    pagespeed LoadFromFile https://www.photographerslounge.org /home/nginx/domains/photographerslounge.org/public;
    pagespeed LoadFromFile https://www.foreverfilm.org /home/nginx/domains/foreverfilm.org/public;
    
    pagespeed LoadFromFile https://mu43-236e.kxcdn.com /home/nginx/domains/mu-43.com/public;
    pagespeed LoadFromFile https://talkemount-236e.kxcdn.com /home/nginx/domains/talkemount.com/public;
    pagespeed LoadFromFile https://fujixspot-236e.kxcdn.com /home/nginx/domains/fujixspot.com/public;
    pagespeed LoadFromFile https://leicaplace-236e.kxcdn.com /home/nginx/domains/leicaplace.com/public;
    pagespeed LoadFromFile https://photolounge-236e.kxcdn.com /home/nginx/domains/photographerslounge.org/public;
    pagespeed LoadFromFile https://foreverfilm-236e.kxcdn.com /home/nginx/domains/foreverfilm.org/public;
    

     
  2. Amin Sabet

    Amin Sabet Member

    49
    7
    8
    Nov 8, 2015
    Ratings:
    +14
    Local Time:
    9:44 PM
    I just added these lines now that my server is http/2:

    Code:
    pagespeed DisableFilters combine_javascript;
    pagespeed DisableFilters combine_css;
    pagespeed DisableFilters sprite_images;
    http2.png
     
  3. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    technically those filters are not required for HTTP/2 but in reality pages are faster with them (domain sharding excluded)

    in theory it should be

    HTTP/2 + ngx_pagespeed > SPDY/3.1 + ngx_pagespeed > HTTP/2 > SPDY/3.1 > HTTP/1.1

    HTTP/2 and SPDY/3.1 close but SPDY is going bye bye so HTTP/2 it is :)
     
  4. negative

    negative Active Member

    382
    45
    28
    Apr 11, 2015
    Ratings:
    +88
    Local Time:
    4:44 AM
    1.9.10
    10.1.11
    @eva2000 Can you please share (if possible edit the 1st post of this thread) the latest and updated your pagespeed.conf ?

    Thanks.
     
  5. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    it is latest updated always
     
  6. negative

    negative Active Member

    382
    45
    28
    Apr 11, 2015
    Ratings:
    +88
    Local Time:
    4:44 AM
    1.9.10
    10.1.11
    Okay then my xenforo is in the /forum directory and i will include the pagespeed.conf on the location /forum section in the nginx domain.conf file i understand that. While i modify your original lines; Should i add the "forum" word to every line ?

    Example it will be like this ?

    Code:
    pagespeed on;
    
    pagespeed LoadFromFile "http://www.domain.com/forum/" "/home/nginx/domains/domain.com/public/forum";
    
    pagespeed Disallow */forum/js/dark/postrating.js*;
    pagespeed Disallow */forum/js/xenforo/tabalerts.js*;
    pagespeed Disallow */forum/lost-password/lost;
    pagespeed Disallow */forum/lost-password/*;
    pagespeed Disallow */forum/payment_callback.php*;
    pagespeed Disallow */forum/munin/*;
    pagespeed Disallow */forum/admincp/*;
     
  7. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yup :)
     
  8. negative

    negative Active Member

    382
    45
    28
    Apr 11, 2015
    Ratings:
    +88
    Local Time:
    4:44 AM
    1.9.10
    10.1.11
    Thank you for your help :)

    I'm running the nginx for a long time but actually i have no courage for enable this feature really :) Because, i must explore every incompatible js or pages in xenforo plus all other add-ons . So i think if i run your pagespeed.conf i will have problem probably due plugin differences. But i will try to enable it healthy :) Thanks again.
     
  9. BobbyWibowo

    BobbyWibowo Active Member

    196
    41
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +70
    Local Time:
    8:44 AM
    1.17.x
    10.3.x
    Oh noice, thanks! Good for references.
     
  10. arlon

    arlon Member

    91
    6
    8
    Feb 20, 2016
    Ratings:
    +12
    Local Time:
    8:44 AM
    1.13.6
    10.1
    i get error when enabling pagespeed, iam using Centmin Mod 1.2.3-eva2000.08,
    i have uncomment the following in /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf: (iam using always SSL)
    include /usr/local/nginx/conf/pagespeed.conf;
    include /usr/local/nginx/conf/pagespeedhandler.conf;
    include /usr/local/nginx/conf/pagespeedstatslog.conf;
    then run pscontrol on i get error "-bash: pscontrol: command not found)
    then 'nrestart' get [emerg] unknown directive "pagespeed" in /usr/local/nginx/conf/pagespeed.conf:1

    the i tried editing centmin.sh and changed NGINX_PAGESPEED=y and then upgrade nginx/recompile

    but still get the same error ,, how to enable nginx pagespeed?
     
  11. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    @arlon see news thread at Nginx 1.9.11 dynamic module compatibility

    123.08stable has disabled ngx_pagespeed and lua nginx modules due to incompatibility with nginx 1.9.11 dynamic modules. If you want ngx_pagespeed for now you need to update Centmin Mod to 123.09beta01 outlined here Beta Branch - Centmin Mod .09 beta branch Testing

    or set in /etc/centminmod/custom_config.inc persistent config file you create or already created and set:
    Code:
    NGINX_PAGESPEED=y
    and then downgrade Nginx to 1.9.10 via centmin.sh menu option 4 recompile on Centmin Mod 123.08stable
     
  12. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Looks like a centmin mod user's question on ngx_pagespeed issue tracker at CSS, JS not combing & Images are not rewriting · Issue #1129 · pagespeed/ngx_pagespeed · GitHub has led to learning something new for me too

    instead of using LoadFromFile format like this which may incorrect try to optimise non-static files
    Code (Text):
    pagespeed LoadFromFile "http://centminmod.com" "/home/nginx/domains/centminmod.com/public";
    pagespeed LoadFromFile "https://centminmod.com" "/home/nginx/domains/centminmod.com/public";
    

    you can use format from LoadFromFileMatch and LoadFromFileRuleMatch to tell ngx_pagespeed to only optimise static files with specific extensions !
    Code (Text):
    pagespeed LoadFromFileMatch "^https?://centminmod.com/" "/home/nginx/domains/centminmod.com/public/";
    pagespeed LoadFromFileRuleMatch disallow .*;
    pagespeed LoadFromFileRuleMatch allow \.css$;
    pagespeed LoadFromFileRuleMatch allow \.jpe?g$;
    pagespeed LoadFromFileRuleMatch allow \.png$;
    pagespeed LoadFromFileRuleMatch allow \.gif$;
    pagespeed LoadFromFileRuleMatch allow \.js$;

    The first line matches both http and https version of site so only use if you have SSL certificate and https and http both working. If only have http site and NO https use
    Code (Text):
    pagespeed LoadFromFileMatch "^http://centminmod.com/" "/home/nginx/domains/centminmod.com/public/";
    pagespeed LoadFromFileRuleMatch disallow .*;
    pagespeed LoadFromFileRuleMatch allow \.css$;
    pagespeed LoadFromFileRuleMatch allow \.jpe?g$;
    pagespeed LoadFromFileRuleMatch allow \.png$;
    pagespeed LoadFromFileRuleMatch allow \.gif$;
    pagespeed LoadFromFileRuleMatch allow \.js$;
    

    or just old LoadFromFile
    Code (Text):
    pagespeed LoadFromFile "http://centminmod.com" "/home/nginx/domains/centminmod.com/public";
    pagespeed LoadFromFileRuleMatch disallow .*;
    pagespeed LoadFromFileRuleMatch allow \.css$;
    pagespeed LoadFromFileRuleMatch allow \.jpe?g$;
    pagespeed LoadFromFileRuleMatch allow \.png$;
    pagespeed LoadFromFileRuleMatch allow \.gif$;
    pagespeed LoadFromFileRuleMatch allow \.js$;
    
     
  13. nfn

    nfn New Member

    29
    0
    1
    Jun 28, 2015
    Ratings:
    +8
    Local Time:
    2:44 AM
    Hi

    With some frequency, me and my members are unable to use the editor.
    I need to flush pagespeed cache to get things working again. Should I change something?

    Anything wrong with this settings?

    Code:
        # Pagespeed
        pagespeed on;
    
        pagespeed Disallow */media/*/full*;
        pagespeed Disallow */countdown.min.js;
        pagespeed Disallow */blockadblock.js;
        pagespeed Disallow */adframe.js;
        pagespeed Disallow */admin.php*;
        pagespeed Disallow */css.php*;
        pagespeed Disallow */misc/purge-cache*;
        pagespeed Disallow */deferred.php*;
        pagespeed Disallow */rgba.php*;
        pagespeed Disallow */posts/*/save-inline*;
        pagespeed Disallow */posts/*/edit*;
        pagespeed Disallow */posts/*/delete*;
        pagespeed Disallow */posts/*/ip*;
        pagespeed Disallow */posts/*/report*;
        pagespeed Disallow */threads/*/move*;
        pagespeed Disallow */threads/*/edit*;
        pagespeed Disallow */threads/*/delete*;
        pagespeed Disallow */threads/*/manage-items/edit*;
        pagespeed Disallow */threads/*/moderator-actions*;
    
        # enable additional filter(s) selectively
        pagespeed EnableFilters collapse_whitespace;
        pagespeed EnableFilters insert_dns_prefetch;
        pagespeed EnableFilters remove_comments;
        pagespeed EnableFilters defer_javascript;
    
        location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
        location ~ "^/pagespeed_static/" { }
        location ~ "^/ngx_pagespeed_beacon$" { }
     
  14. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  15. pamamolf

    pamamolf Premium Member Premium Member

    3,774
    366
    83
    May 31, 2014
    Ratings:
    +706
    Local Time:
    4:44 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Any tested working config for IPB 4 ?

    Maybe @Jimmy ?
     
  16. Jimmy

    Jimmy Well-Known Member

    1,676
    364
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +912
    Local Time:
    9:44 PM
    1.17.x
    MariaDB 10.3.x
    I haven't worked on anything related to IPB 4 and pagespeed.
     
  17. RB1

    RB1 Active Member

    285
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    6:44 PM
    Nginx 1.18.x
    MariaDB 10.1.x
    I know it's not exactly related to this thread, but is this pagespeed.conf what is compiled by default with CMM or are changes automatically made to it?

    I'm just wondering because the default pagespeed.conf after installing CMM was correctly rewriting images, however, after messing something up and replacing the config with the one from github, it stopped optimizing images.

    I just fixed it and images are being optimized now, but how can I start from scratch with the defaults?
     
  18. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    default pagespeed.conf has image rewrites/optimisations disabled and have to enable and tweak like this thread's posted config AFAIK.

    The default pagespeed.conf in 123.09beta01 centminmod/pagespeed.conf at 123.09beta01 · centminmod/centminmod · GitHub
     
  19. RB1

    RB1 Active Member

    285
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    6:44 PM
    Nginx 1.18.x
    MariaDB 10.1.x
    Hmm I could've sworn that image rewriting worked out of the box when I enabled page speed.

    What exactly is the difference between these? Seems pointless if they both are the same thing as you can just comment out enabled?
     
  20. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:44 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    enable rewrite_images filter is enabled by default even if not mentioned in pagespeed.conf, that's why DisableFilters one is needed