Open Lofesa opened 7 years ago
Quick recap for context in this bug:
https://github.com/pagespeed/mod_pagespeed/issues/1263 tracked pagespeed not invalidating AMP pages by disabling any filters that inject scripts, etc. This was closed and released with 1.12.
later in that bug, Lofesa found his site was being AMP-invalidated by PageSpeed, despite our thinking this is fixed. The site is reached from these URLs.
https://intersindical.intersindicalrm.org/la-confederacion-intersindical-rechaza-folleto-hazte-oir/amp/ https://intersindical.intersindicalrm.org/la-confederacion-intersindical-rechaza-folleto-hazte-oir/?amp
This AMP site is powered by two Wordpress AMP plugins: https://wordpress.org/plugins/amp/ https://wordpress.org/plugins/accelerated-mobile-pages/
In my testing locally, I was unable to repro this problem. Specifying 'amp' in the HTML tag prevented the injection of pagespeed style rendering scripts with prioritize_critical_css enabled.
Lofesa -- in the config files you shared, there is some caching going on outside PageSpeed. Could you flush those caches just to be sure? You can also flush the pagespeed cache while you are at it.
There is a fastcgi_cache_path and some open_file_cache* directives.
I can't really think of what scenario an external cache would cause this bug, but it's worth flushing just to be sure.
HI @jmarantz I think these 2 caches are not related. The fastcgi_cache is defined in the http section but is not used by the php-fpm config for the WP site, I have a moodle site with a diferrent php-fpm config that uses it. Anyway this cache has a ttl of 20 minutes. The open_file cache has a ttl of 5 minutes and is used to put in ram memory static files. If I use the workaround posted by @jeffkaufman in #1263 (disabling Prioritize critical CSS for request with /amp/ or /?amp) the js is not injected. How I can help?
Extrange things As you can see, the js script for Prioritize critical CSS is in the amp page but...
1.- In the google amp validator the https://intersindical.intersindicalrm.org/la-confederacion-intersindical-rechaza-folleto-hazte-oir/amp/ allways get validated status
2.- In the ampproject validator some thimes get invalidated status because the script is here and some times get validated. Mostly if you run the validator for the 1st time get invalid status and in the 2dn run get valid status
I was poking around your HTML to see if anything in there might fool our AMP detector. I suspected maybe a byte-order-marker. But I didn't see one in your HTML when fetched with "?PageSpeed=off". In my tiny testcase I duplicated the first bytes from your HTML exactly and it works fine in ngx_pagespeed on my machine.
My next thought is to send you a source patch which would add some debug logging to PageSpeed's AMP-related code, so we could figure out where it's going wrong. Would you be able to apply a source patch?
Sure. I am glad to help. You can send the pach to the email address I send you the config files and I apply to the NPS and regenerate the rpm´s, no problem on that. If you think I must change anything in config files you can say it or if you need the list of all plugins I have in the WP site
I open this issue as suggested by @jmarantz in #1263
I send the config files in a private mail....