You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2020/04/08 03:42:32 UTC

[GitHub] [incubator-pagespeed-ngx] ShadowXVII opened a new issue #1685: Pagespeed causes high FTTB on nginx

ShadowXVII opened a new issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685
 
 
   For some reason my pagespeed module is causing slowness on a basic server with Azure Front Door at the start. There was a noticeable FTTB delay with `pagespeed on;` which you can see from our status monitoring how much the perf improved after that.
   
   ![image](https://user-images.githubusercontent.com/446329/78741842-c333ce00-799d-11ea-9783-fecdbcb905ae.png)
   
   Ironically the page speed scores are better with it on, assumedly because the scripts aren't being consolidated, etc.
   
   It's running on `Ubuntu 18.04.4 LTS` nginx version `nginx/1.17.3`. Pagespeed module is provided by ppa:ondrej/php -- the closest version I could find is `1.17.3-2-ppa7~bionic`. Not sure if there's more info I can provide there.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612871452
 
 
   Sorry, I know it's a very vague question! I'll try and get some more metrics.
   
   The pagespeed is on a disk, with a redis cache also. 
   The proxy type is Azure Front Door which is Microsoft's CDN network. I have unique query URLs cached -- it should also respect cache headers from source. Maybe the two aren't interacting well together.
   
   Switching pagespeed off and on using the URL parameters causes a difference:
   ![image](https://user-images.githubusercontent.com/446329/79118597-b534e180-7dd1-11ea-8314-388d3ba41612.png)
   
   The timings when debug is enabled are as follows:
   
   ```
   <!--
   mod_pagespeed on
   Filters:
   db	Debug
   hw	Flushes html
   
   Options:
   AvoidRenamingIntrospectiveJavascript (aris) True
   EnableCachePurge (euci) True
   EnableRewriting (e) 1
   FileCacheCleanIntervalMs (afcci) 86400000
   FileCacheInodeLimit (afcl) 500000
   FileCacheSizeKb (afc) 2048000
   RewriteLevel (l) Pass Through
   Statistics (ase) True
   StatisticsLogging (asle) True
   
   #NumFlushes            0
   #EndDocument after     216021us
   #Total Parse duration  2208us
   #Total Render duration 695us
   #Total Idle duration   213813us
   The following filters were disabled for this request:
   	SupportNoscript
   -->
   ```
   
   The config is currently as follows:
   
   ```
   # pagespeed
   pagespeed standby;
   
   pagespeed FileCachePath "/var/cache/pagespeed/";
   pagespeed FileCacheSizeKb            2048000;
   pagespeed FileCacheCleanIntervalMs   86400000;
   pagespeed FileCacheInodeLimit        500000;
   
   pagespeed RedisServer "localhost:6379";
   
   pagespeed RewriteLevel PassThrough;
   pagespeed DisableFilters "rewrite_images,resize_images";
   
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   
   pagespeed EnableCachePurge on;
   pagespeed PurgeMethod PURGE;
   ```
   
   So if I interpret those stats correctly, the long Idle duration suggests the FTTB is mostly caused by the underlying page?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612871452
 
 
   Sorry, I know it's a very vague question! I'll try and get some more metrics.
   
   The pagespeed is on a disk, with a redis cache also. 
   The proxy type is Azure Front Door which is Microsoft's CDN network. I have unique query URLs cached -- it should also respect cache headers from source. Maybe the two aren't interacting well together.
   
   Switching pagespeed off and on using the URL parameters causes a difference:
   ![image](https://user-images.githubusercontent.com/446329/79118597-b534e180-7dd1-11ea-8314-388d3ba41612.png)
   
   The timings when debug is enabled are as follows:
   
   ```<!--
   mod_pagespeed on
   Filters:
   db	Debug
   hw	Flushes html
   
   Options:
   AvoidRenamingIntrospectiveJavascript (aris) True
   EnableCachePurge (euci) True
   EnableRewriting (e) 1
   FileCacheCleanIntervalMs (afcci) 86400000
   FileCacheInodeLimit (afcl) 500000
   FileCacheSizeKb (afc) 2048000
   RewriteLevel (l) Pass Through
   Statistics (ase) True
   StatisticsLogging (asle) True
   
   #NumFlushes            0
   #EndDocument after     216021us
   #Total Parse duration  2208us
   #Total Render duration 695us
   #Total Idle duration   213813us
   The following filters were disabled for this request:
   	SupportNoscript
   -->```
   
   The config is currently as follows
   
   
   ```
   
   # pagespeed
   pagespeed standby;
   
   pagespeed FileCachePath "/var/cache/pagespeed/";
   pagespeed FileCacheSizeKb            2048000;
   pagespeed FileCacheCleanIntervalMs   86400000;
   pagespeed FileCacheInodeLimit        500000;
   
   pagespeed RedisServer "localhost:6379";
   
   pagespeed RewriteLevel PassThrough;
   pagespeed DisableFilters "rewrite_images,resize_images";
   
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   
   pagespeed EnableCachePurge on;
   pagespeed PurgeMethod PURGE;
   
   ```
   
   So if I interpret those stats correctly, the long Idle duration suggests the FTTB is mostly caused by the underlying page?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613152557
 
 
   The Cache-Control is dictated by the Pagespeed module. The documentation suggests
   `By default PageSpeed serves HTML files with Cache-Control: no-cache, max-age=0`
   
   Which means with PageSpeed=off it'll go back to default NGINX, which is no Cache-Control header.
   
   The headers echo this in the request as i'm getting a `TCP_MISS` for `PageSpeed=on` and `TCP_HIT` for `PageSpeed=off`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612999657
 
 
   As far as I know w/ RewriteLevel PassThrough only explicit enabled filters works, and you have none enabled.
   Whats filters have you enabled in the url?
   In other hand when you set PageSpeed=off the "original" headers are used, so if you have cache-control in place, the url is stored in the proxy cache, but when you have PageSpeed=on, cache-control header is set to max-age=0 and is not stored in the proxy cache.
   
   But the 16ms/676ms are not the TTFB, these are total time for these url.
   For a better measure of TTFB you can use some tool like https://www.webpagetest.org/ and see what this tools say in the First Byte
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613192821
 
 
   Yeah it's probably easiest if you stick with the optimization that don't
   require modifying URLs in HTML. I'd use OptimizeForBandwidth
   <https://modpagespeed.com/doc/optimize-for-bandwidth>. You won't get
   combine_css but you'll get compression and minification.
   
   What I don't remember is whether setting that mode also allows retention of
   the origin html caching headers. But if it doesn't you can use
   https://www.modpagespeed.com/doc/configuration#ModifyCachingHeaders
   
   pagespeed ModifyCachingHeaders off;
   
   
   On Mon, Apr 13, 2020 at 9:48 PM Jake Edwards <no...@github.com>
   wrote:
   
   > Yes, seems to be the default cache taking control here:
   >
   > *If no Cache-Control is present the default behavior is that AFD will
   > cache the resource for X amount of time where X is randomly picked between
   > 1 to 3 days.* (source
   > <https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration>
   > )
   >
   > Is it possible to get PageSpeed to just serve cacheable assets as
   > Downstream Cache config won't work with Azure Front Door. I would like to
   > just use the Javascript, CSS Concat and Compression, or are they dependant
   > on the beacons?
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613181611>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAO2IPKA5TOCFCTM6CHTGQTRMO6H3ANCNFSM4MDTLW7Q>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-611051390
 
 
   There maybe a bunch of causes to get bad TTFB.
   Where is the pagespeed cahe? memory? disk (what type)?
   What happens when you disables pagespeed? (pagespeed unpluged;)
   Is IPRO working? (In-place Resource Optimization)
   Are you using some proxy type?
   And so on....

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612871452
 
 
   Sorry, I know it's a very vague question! I'll try and get some more metrics.
   
   The pagespeed is on a disk, with a redis cache also. 
   The proxy type is Azure Front Door which is Microsoft's CDN network. I have unique query URLs cached -- it should also respect cache headers from source. Maybe the two aren't interacting well together.
   
   Switching pagespeed off and on using the URL parameters causes a difference:
   ![image](https://user-images.githubusercontent.com/446329/79118597-b534e180-7dd1-11ea-8314-388d3ba41612.png)
   
   The timings when debug is enabled are as follows:
   
   ```<!--
   mod_pagespeed on
   Filters:
   db	Debug
   hw	Flushes html
   
   Options:
   AvoidRenamingIntrospectiveJavascript (aris) True
   EnableCachePurge (euci) True
   EnableRewriting (e) 1
   FileCacheCleanIntervalMs (afcci) 86400000
   FileCacheInodeLimit (afcl) 500000
   FileCacheSizeKb (afc) 2048000
   RewriteLevel (l) Pass Through
   Statistics (ase) True
   StatisticsLogging (asle) True
   
   #NumFlushes            0
   #EndDocument after     216021us
   #Total Parse duration  2208us
   #Total Render duration 695us
   #Total Idle duration   213813us
   The following filters were disabled for this request:
   	SupportNoscript
   -->```
   
   The config is currently as follows
   
   ```# pagespeed
   pagespeed standby;
   
   pagespeed FileCachePath "/var/cache/pagespeed/";
   pagespeed FileCacheSizeKb            2048000;
   pagespeed FileCacheCleanIntervalMs   86400000;
   pagespeed FileCacheInodeLimit        500000;
   
   pagespeed RedisServer "localhost:6379";
   
   pagespeed RewriteLevel PassThrough;
   pagespeed DisableFilters "rewrite_images,resize_images";
   
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   
   pagespeed EnableCachePurge on;
   pagespeed PurgeMethod PURGE;```
   
   So if I interpret those stats correctly, the long Idle duration suggests the FTTB is mostly caused by the underlying page?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613001771
 
 
   qq: with pagespeed off, is your HTML cacheable in the CDN?
   
   What drives the origin response, is there a database lookup of some sort?
   
   
   On Mon, Apr 13, 2020 at 1:24 PM Lofesa <no...@github.com> wrote:
   
   > As far as I know w/ RewriteLevel PassThrough only explicit enabled filters
   > works, and you have none enabled.
   > Whats filters have you enabled in the url?
   > In other hand when you set PageSpeed=off the "original" headers are used,
   > so if you have cache-control in place, the url is stored in the proxy
   > cache, but when you have PageSpeed=on, cache-control header is set to
   > max-age=0 and is not stored in the proxy cache.
   >
   > But the 16ms/676ms are not the TTFB, these are total time for these url.
   > For a better measure of TTFB you can use some tool like
   > https://www.webpagetest.org/ and see what this tools say in the First Byte
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612999657>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAO2IPLMISOITUNFMGMEMVDRMNDFXANCNFSM4MDTLW7Q>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613181611
 
 
   Yes, seems to be the default cache taking control here:
   
   _If no Cache-Control is present the default behavior is that AFD will cache the resource for X amount of time where X is randomly picked between 1 to 3 days._ ([source](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration))
   
   Is it possible to get PageSpeed to just serve cacheable assets as Downstream Cache config won't work with Azure Front Door. I would like to just use the Javascript, CSS Concat and Compression, or are they dependant on the beacons?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613152557
 
 
   The Cache-Control is currently dictated by the Pagespeed module. 
   
   The documentation suggests `By default PageSpeed serves HTML files with Cache-Control: no-cache, max-age=0`
   
   Which means with `PageSpeed=off` it'll go back to default NGINX, which is the absence of any `Cache-Control` header. I checked this by querying origin directly, no header was returned.
   
   When querying the CDN with my requests, Azure Front Door adds headers to indicate Hit/Miss -- I'm getting a `TCP_MISS` for `PageSpeed=on` and `TCP_HIT` for `PageSpeed=off`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613142726
 
 
   ### Timings
   @Lofesa , re: TTFB, I wasn't clear with my timings -- the full details are provided by Chrome which the lionshare of that figure is TTFB in my scenario.
   
   No Pagespeed in URL (standby)
   ![image](https://user-images.githubusercontent.com/446329/79169561-1db2ab80-7e30-11ea-8111-b646f0d33ac8.png)
   
   With PageSpeed (?PageSpeed=on&PageSpeedFilters=%20debug)
   ![image](https://user-images.githubusercontent.com/446329/79169602-315e1200-7e30-11ea-8746-528a7b2ab7e5.png)
   
   ### Cache
   I think Cache Control might be the culprit here (or rather, is causing it to look like PageSpeed).
   @jmarantz , I'm not sure -- [the documentation is ambiguous](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration) -- It says "assets" are cached, but doesn't mention HTML output. The origin request is to a Wordpress website, backed by redis.
   
   Maybe I can use some cache control headers to bypass the CDN temporarily to verify the behaviour?
   
   From further reading of [Downstream Caches](https://www.modpagespeed.com/doc/downstream-caching), it might just not be possible to run both. I'd like to use pagespeed for the basic page optimization, but skip the beacons etc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613163035
 
 
   So the Cache-Control at origin -- that is, with pagespeed in standby, is
   empty? In that case the CDN might be configurable as to whether it would
   cache HTML by default, and for how long. You might be able to control that
   behavior at the CDN.
   
   If the CDN is caching your HTML, it's going to significantly improve the
   TTFB obviously. You can also achieve this with PageSpeed via its downstream
   caching feature, but how to do that is dependent on the downstream cache,
   and PageSpeed only documents the flow for Varnish.
   
   https://www.modpagespeed.com/doc/downstream-caching
   
   
   On Mon, Apr 13, 2020 at 7:54 PM Jake Edwards <no...@github.com>
   wrote:
   
   > The Cache-Control is dictated by the Pagespeed module. The documentation
   > suggests
   > By default PageSpeed serves HTML files with Cache-Control: no-cache,
   > max-age=0
   >
   > Which means with PageSpeed=off it'll go back to default NGINX, which is no
   > Cache-Control header.
   >
   > The headers echo this in the request as i'm getting a TCP_MISS for
   > PageSpeed=on and TCP_HIT for PageSpeed=off
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613152557>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAO2IPLAGRGQXR5P2W47AI3RMOQZZANCNFSM4MDTLW7Q>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613142726
 
 
   ### Timings
   @Lofesa , re: TTFB, I wasn't clear with my timings -- the full details are provided by Chrome which the lionshare of that figure is TTFB in my scenario.
   
   No Pagespeed in URL (standby)
   ![image](https://user-images.githubusercontent.com/446329/79169561-1db2ab80-7e30-11ea-8111-b646f0d33ac8.png)
   
   With PageSpeed (?PageSpeed=on&PageSpeedFilters=%20debug)
   ![image](https://user-images.githubusercontent.com/446329/79169602-315e1200-7e30-11ea-8746-528a7b2ab7e5.png)
   
   ### Cache
   I think Cache Control might be the culprit here (or rather, is causing it to look like PageSpeed).
   @jmarantz , I'm not sure -- [the documentation is ambiguous](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration) -- It says "assets" are cached, but doesn't mention HTML output. The origin request is to a Wordpress website, backed by redis.
   
   Maybe I can use some cache control headers to bypass the CDN temporarily to verify the behaviour?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-612871452
 
 
   Sorry, I know it's a very vague question! I'll try and get some more metrics.
   
   The pagespeed is on a disk, with a redis cache also. 
   The proxy type is Azure Front Door which is Microsoft's CDN network. I have unique query URLs cached -- it should also respect cache headers from source. Maybe the two aren't interacting well together.
   
   Switching pagespeed off and on using the URL parameters causes a difference:
   ![image](https://user-images.githubusercontent.com/446329/79118597-b534e180-7dd1-11ea-8314-388d3ba41612.png)
   
   The timings when debug is enabled are as follows:
   
   ```<!--
   mod_pagespeed on
   Filters:
   db	Debug
   hw	Flushes html
   
   Options:
   AvoidRenamingIntrospectiveJavascript (aris) True
   EnableCachePurge (euci) True
   EnableRewriting (e) 1
   FileCacheCleanIntervalMs (afcci) 86400000
   FileCacheInodeLimit (afcl) 500000
   FileCacheSizeKb (afc) 2048000
   RewriteLevel (l) Pass Through
   Statistics (ase) True
   StatisticsLogging (asle) True
   
   #NumFlushes            0
   #EndDocument after     216021us
   #Total Parse duration  2208us
   #Total Render duration 695us
   #Total Idle duration   213813us
   The following filters were disabled for this request:
   	SupportNoscript
   -->```
   
   The config is currently as follows
   
   
   ```
   # pagespeed
   pagespeed standby;
   
   pagespeed FileCachePath "/var/cache/pagespeed/";
   pagespeed FileCacheSizeKb            2048000;
   pagespeed FileCacheCleanIntervalMs   86400000;
   pagespeed FileCacheInodeLimit        500000;
   
   pagespeed RedisServer "localhost:6379";
   
   pagespeed RewriteLevel PassThrough;
   pagespeed DisableFilters "rewrite_images,resize_images";
   
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   
   pagespeed EnableCachePurge on;
   pagespeed PurgeMethod PURGE;
   ```
   
   So if I interpret those stats correctly, the long Idle duration suggests the FTTB is mostly caused by the underlying page?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613181611
 
 
   Yes, seems to be the default cache taking control here:
   
   _If no Cache-Control is present the default behavior is that AFD will cache the resource for X amount of time where X is randomly picked between 1 to 3 days._ ([source](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration))
   
   Is it possible to get PageSpeed to just serve cacheable assets as Downstream Cache config won't work with Azure Front Door. I would like to just use the Javascript, CSS Concat and Compression, or are they dependant on the beacons?
   
   **EDIT:** Testing out 
   ```
   pagespeed ModifyCachingHeaders off;
   pagespeed CriticalImagesBeaconEnabled false;
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
Lofesa commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613307052
 
 
   And an other thing to look at nginx config is the ssl config. Take a look a this https://haydenjames.io/nginx-tuning-tips-tls-ssl-https-ttfb-latency/

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613142726
 
 
   ### Timings
   @Lofesa , re: TTFB, I wasn't clear with my timings -- the full details are provided by Chrome which the lionshare of that figure is TTFB in my scenario.
   
   No Pagespeed in URL (standby)
   ![image](https://user-images.githubusercontent.com/446329/79169561-1db2ab80-7e30-11ea-8111-b646f0d33ac8.png)
   
   With PageSpeed (?PageSpeed=on&PageSpeedFilters=%20debug)
   ![image](https://user-images.githubusercontent.com/446329/79169602-315e1200-7e30-11ea-8746-528a7b2ab7e5.png)
   
   ### Cache
   I think Cache Control might be the culprit here (or rather, is causing it to look like PageSpeed).
   @jmarantz , I'm not sure -- [the documentation is ambiguous](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration) -- It says "assets" are cached, but doesn't mention HTML output. The origin request is to a Wordpress website, backed by redis.
   
   Maybe I can use some cache control headers to bypass the CDN temporarily to verify the behaviour?
   
   From further reading of Downstream Caches, it might just not be possible to run both. I'd like to use pagespeed for the basic page optimization, but skip the beacons etc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
jmarantz commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613146315
 
 
   What is the Cache-Control header for your HTML? Usually if you set your
   cache-control explicitly, a CDN will just use that and won't care whether
   the assets are HTML or other types. What is your cache-control header at
   the origin?
   
   
   On Mon, Apr 13, 2020 at 7:17 PM Jake Edwards <no...@github.com>
   wrote:
   
   > Timings
   >
   > @Lofesa <https://github.com/Lofesa> , re: TTFB, I wasn't clear with my
   > timings -- the full details are provided by Chrome which the lionshare of
   > that figure is TTFB in my scenario.
   >
   > No Pagespeed in URL (standby)
   > [image: image]
   > <https://user-images.githubusercontent.com/446329/79169561-1db2ab80-7e30-11ea-8111-b646f0d33ac8.png>
   >
   > With PageSpeed (?PageSpeed=on&PageSpeedFilters=%20debug)
   > [image: image]
   > <https://user-images.githubusercontent.com/446329/79169602-315e1200-7e30-11ea-8746-528a7b2ab7e5.png>
   > Cache
   >
   > I think Cache Control might be the culprit here (or rather, is causing it
   > to look like PageSpeed).
   > @jmarantz <https://github.com/jmarantz> , I'm not sure -- the
   > documentation is ambiguous
   > <https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration>
   > -- It says "assets" are cached, but doesn't mention HTML output. The origin
   > request is explained
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613142726>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAO2IPMN4WE2TL3WLRIJQBLRMOMRLANCNFSM4MDTLW7Q>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII edited a comment on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613152557
 
 
   The Cache-Control is currently dictated by the Pagespeed module. 
   
   The documentation suggests `By default PageSpeed serves HTML files with Cache-Control: no-cache, max-age=0`
   
   Which means with `PageSpeed=off` it'll go back to default NGINX, which is the absence of any `Cache-Control` header. I checked this by querying origin directly, no header was returned.
   
   When querying the CDN with my requests, Azure Front Door adds headers to indicate Hit/Miss -- I'm getting a `TCP_MISS` for `PageSpeed=on` and `TCP_HIT` for `PageSpeed=off`
   
   So I guess in summary, the caching at the CDN is causing PageSpeed to appear slower due to no caching. 
   
   **Question**: Is it possible to use PageSpeed to serve cacheable assets, such as concatenated and compressed scripts?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-pagespeed-ngx] ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx

Posted by GitBox <gi...@apache.org>.
ShadowXVII commented on issue #1685: Pagespeed causes high FTTB on nginx
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1685#issuecomment-613142726
 
 
   ### Timings
   @Lofesa , re: TTFB, I wasn't clear with my timings -- the full details are provided by Chrome which the lionshare of that figure is TTFB in my scenario.
   
   No Pagespeed in URL (standby)
   ![image](https://user-images.githubusercontent.com/446329/79169561-1db2ab80-7e30-11ea-8111-b646f0d33ac8.png)
   
   With PageSpeed (?PageSpeed=on&PageSpeedFilters=%20debug)
   ![image](https://user-images.githubusercontent.com/446329/79169602-315e1200-7e30-11ea-8746-528a7b2ab7e5.png)
   
   ### Cache
   I think Cache Control might be the culprit here (or rather, is causing it to look like PageSpeed).
   @jmarantz , I'm not sure -- [the documentation is ambiguous](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-caching#cache-expiration) -- It says "assets" are cached, but doesn't mention HTML output. The origin request is explained 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services