Learn about Centmin Mod LEMP Stack today
Register Now

PageSpeed This forum's pagespeed.conf

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

  1. Tracy Perry

    Tracy Perry Active Member

    213
    87
    28
    Aug 24, 2014
    Texas
    Ratings:
    +145
    Local Time:
    8:43 PM
    1.11.5
    MariaDB 10.0.28
    @eva2000, if one was hosting multiple domains on one VPS, would you use separate .conf (commenting it out in the nginx.conf and placing it in the vhost def) files or just do multiple
    Code:
    pagespeed LoadFromFile "http://domain1.com""/home/nginx/domains/domain1.com/public";
    pagespeed LoadFromFile "https://domain1.com""/home/nginx/domains/domain1.com/public";
    pagespeed LoadFromFile "http://domain2.com""/home/nginx/domains/domain2.com/public";
    pagespeed LoadFromFile "https://domain2.com""/home/nginx/domains/domain2.com/public";

     
  2. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    I just use same .conf and use multiple lines in pagespeed.conf makes it easier to manage :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ngx_pagespeed 1.9.32-1 beta enables in place options by default, disabling it for forum'ss pagespeed.conf due to issues

    Code:
    pagespeed InPlaceResourceOptimization off;
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Added 2 more disable/excluded urls for Xenforo for ngx_pagespeed's pagespeed.conf

    Code:
    pagespeed Disallow */lost-password/lost;
    pagespeed Disallow */lost-password/*; 
     
  5. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    Enabled back ngx_pagespeed on my forum :)
    Just to be sure, to double check I don't miss something here.

    1. In centmin.sh, Enable ngx_pagespeed: NGINX_PAGESPEED=y
    2. Re-run Menu 4 to re-install Nginx with pagespeed
    3. In nginx.conf, enable/be sure this line is present include /usr/local/nginx/conf/pagespeedadmin.conf;
    4. In domain config below server_name
    5. # ngx_pagespeed & ngx_pagespeed handler
      include /usr/local/nginx/conf/pagespeed.conf;
      include /usr/local/nginx/conf/pagespeedhandler.conf;
      include /usr/local/nginx/conf/pagespeedstatslog.conf;
    6. Then pagespeed.conf, be sure it's pagespeed on;
    7. Then ngxrestart

    That's it? :D
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yup exact steps I'd take to re-enable ngx_pagespeed :D
     
  7. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    Mine, updated config :)
    Code:
    pagespeed on;
    
    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*;
    pagespeed Disallow */js/rellect/AdblockDetector/advertisement.js*;
    pagespeed Disallow *advertisement.js*;
    pagespeed Disallow *adsbygoogle*;
    pagespeed Disallow *google_ad*;
    pagespeed Disallow *show_ad*;
    pagespeed Disallow *adsbygoogle.js*;
    pagespeed Disallow */data/bdCache/css/*;
    
    pagespeed MemcachedThreads 1;
    pagespeed MemcachedServers "localhost:11211";
    pagespeed MemcachedTimeoutUs 100000;
    
    pagespeed XHeaderValue "pagespeed";
    
    pagespeed PreserveUrlRelativity on;
    pagespeed MaxCombinedCssBytes -1;
    pagespeed ImageResolutionLimitBytes 16777216;
    pagespeed AvoidRenamingIntrospectiveJavascript on;
    pagespeed ImageInlineMaxBytes 3072;
    pagespeed CssImageInlineMaxBytes 0;
    pagespeed InPlaceResourceOptimization off;
    pagespeed MaxCombinedJsBytes 140000;
    pagespeed MaxInlinedPreviewImagesIndex 6;
    pagespeed MinImageSizeLowResolutionBytes 3072;
    
    ## ngx_pagespeed filters settings below ##
    pagespeed RewriteLevel CoreFilters;
    pagespeed EnableFilters elide_attributes;
    pagespeed EnableFilters dedup_inlined_images;
    pagespeed EnableFilters collapse_whitespace,remove_comments;
    pagespeed EnableFilters make_google_analytics_async;
    pagespeed EnableFilters prioritize_critical_css;
    pagespeed EnableFilters move_css_to_head;
    pagespeed EnableFilters move_css_above_scripts;
    pagespeed EnableFilters combine_css;
    pagespeed EnableFilters combine_javascript;
    pagespeed EnableFilters rewrite_css;
    pagespeed EnableFilters rewrite_javascript;
    pagespeed EnableFilters inline_javascript;
    pagespeed EnableFilters inline_preview_images;
    pagespeed EnableFilters resize_mobile_images;
    pagespeed EnableFilters lazyload_images;
    pagespeed LazyloadImagesAfterOnload off;
    pagespeed EnableFilters rewrite_images;
    pagespeed EnableFilters convert_png_to_jpeg;
    pagespeed EnableFilters convert_jpeg_to_webp;
    pagespeed EnableFilters convert_to_webp_lossless;
    pagespeed EnableFilters rewrite_css,sprite_images;
    pagespeed EnableFilters insert_dns_prefetch;
    pagespeed EnableFilters inline_google_font_css;
    
    pagespeed DisableFilters defer_javascript;
    ### END
    
    
     
  8. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    6:13 AM
    1.9.x
    5.5
    hi , there is't any wordpress pagespeed.conf + Vbulltien ?
     
  9. eva2000

    eva2000 Administrator Staff Member

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

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Updated to Xenforo 1.4.6 here and seems pagespeed defer js seems to cause rendering issues on index page reloads and it's due to /js/xenforo/tabalerts.js* in Xenforo 1.4.x. So disabling it from pagespeed.conf via command shortcut to edit pagespeed.conf = pscontrol edit

    add a pagespeed Disallow for the specific js file and restart Nginx server

    Code:
    pagespeed Disallow */js/xenforo/tabalerts.js*;
     
  11. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    That's not from XenForo 1.4 :)
    From this addon: Tab Alerts | XenForo Community
     
  12. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    doh strange then as i had that installed on Xenforo 1.3.x and didn't have the problems.. oh well :)
     
  13. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    What problem is it?
     
  14. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    The whole index page's style is broken with white background page with text display for about 0.5 of second before being rendered properly :)
     
  15. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    Ah, that's why I don't enable defer js :D
     
  16. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    or just disallow problematic js files AND keep defer js enabled :D
     
  17. rdan

    rdan Well-Known Member

    4,924
    1,174
    113
    May 25, 2014
    Ratings:
    +1,773
    Local Time:
    9:43 AM
    Mainline
    10.2
    Does this small file affect index page? or all pages?
     
  18. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    don't remember specifically !
     
  19. eva2000

    eva2000 Administrator Staff Member

    44,186
    10,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,572
    Local Time:
    11:43 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    new addition to exclude postrating.js from pagespeed for forums
    Code:
    pagespeed Disallow */js/dark/postrating.js*;
     
  20. quicksalad

    quicksalad Member

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    7:13 AM
    does running pscontrol on atuomatically enable nginx pagespeed? i see all css are combined already by just running pscontrol on and without touching vhost and domain.com.conf.