mod_pagespeed creating errors on accelerated mobile pages (AMP)

742 views
Skip to first unread message

ka...@consumermedia.com

unread,
Feb 1, 2016, 12:50:42 PM2/1/16
to mod-pagespeed-discuss
Hello Everyone,

Our mod_pagespeed optimizations do not pass AMP validation. Does anyone know how to disable mod_pagespeed from running on specific pages or how to make it AMP compliant?

Thanks!

Karl




AMP Validation Errors (all related to mod_pagespeed)
  • The attribute 'rel' in tag 'link rel=' is set to the invalid value 'stylesheet'.
  • The mandatory text (CDATA) inside tag 'boilerplate (noscript) - old variant' is missing or incorrect.
  • The tag 'boilerplate (noscript) - old variant' appears more than once in the document.
  • The attribute 'amp-custom' may not appear in tag 'boilerplate (js enabled) - old variant'.
  • The parent tag of tag 'style' is 'noscript', but it can only be 'head'.
  • The mandatory attribute 'src' is missing in tag 'amphtml engine v0.js script'.
  • The mandatory attribute 'async' is missing in tag 'amphtml engine v0.js script'.
  • The parent tag of tag 'script' is 'body', but it can only be 'head'.

Here are the mod_pagespeed settings for one of our accelerated mobile pages with the errors:

mod_pagespeed Filters
  • ah Add Head
  • cw Collapse Whitespace
  • cc Combine Css
  • gp Convert Gif to Png
  • jp Convert Jpeg to Progressive
  • jw Convert Jpeg To Webp
  • mc Convert Meta Tags
  • pj Convert Png to Jpeg
  • ws When converting images to WebP, prefer lossless conversions
  • db Debug
  • dd Dedup Inlined Images
  • ea Elide Attributes
  • ec Cache Extend Css
  • ei Cache Extend Images
  • es Cache Extend Scripts
  • fc Fallback Rewrite Css 
  • if Flatten CSS Imports
  • hw Flushes html
  • ci Inline Css
  • ii Inline Images
  • il Inline @import to Link
  • ji Inline Javascript
  • idp Insert DNS Prefetch
  • js Jpeg Subsampling
  • ll Lazyload Images
  • pr Prioritize Critical Css
  • rj Recompress Jpeg
  • rp Recompress Png
  • rw Recompress Webp
  • rc Remove Comments
  • ri Resize Images
  • ir Resize to Rendered Image Dimensions
  • cf Rewrite Css
  • rd Rewrite Domains
  • jm Rewrite External Javascript
  • jj Rewrite Inline Javascript
  • cu Rewrite Style Attributes With Url
  • cp Strip Image Color Profiles
  • md Strip Image Meta Data

mod_pagespeed Options
  • AvoidRenamingIntrospectiveJavascript (aris) True
  • EnableCachePurge (euci) True
  • EnableRewriting (e) 1
  • FileCacheInodeLimit (afcl) 500000
  • MemcachedThreads (amt) 2
  • RewriteLevel (l) Core Filters
  • RewriteRandomDropPercentage (rrdp) 0
  • Statistics (ase) True
  • StatisticsLogging (asle) True
  • SupportNoScriptEnabled (snse) False

The following filters were disabled for this request
  • Lazyload Images

Joshua Marantz

unread,
Feb 1, 2016, 12:56:59 PM2/1/16
to mod-pagespeed-discuss
One thing that pops out from your config is elide_attributes.  That is responsible for some of the AMP violations (as well as strict HTML4 validators).  However that might not be sufficient to resolve all the errors you pasted.


In general, my recommendation for AMP compatibility is to use
  RewriteLevel OptimizeForBandwidth
This disables many of the latency-saving features of mod_pagespeed, retaining the data-saving features.

It's an open and interesting question how MPS & AMP can work better together.

-Josh

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/9aec4d3d-7c97-49b5-9619-dc25f4fec11c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Quang Le

unread,
Jun 7, 2016, 12:10:22 PM6/7/16
to mod-pagespeed-discuss
I have near the same problem with you today. But i can fix it now.
Could you try to unintall some plugins on your website, then check install step by step again,

Then try to find out which plugin make this error, After that check the setting on that plugin.

Some plugins will conflict and cause the problem. Prevous time, I install WP Fastest cache plugin on my wordpress, it make error when i run http://quanglepro.com/2016/04/13/tao-hieu-ung-chuyen-dong-cho-website-voi-revolution-slider/amp/#development=1

This is my site: http://quanglepro.com

Thank you
Quangle


Vào 00:50:42 UTC+7 Thứ Ba, ngày 02 tháng 2 năm 2016, ka...@consumermedia.com đã viết:

Joshua Marantz

unread,
Jun 7, 2016, 1:02:21 PM6/7/16
to mod-pagespeed-discuss
FWIW the AMP/PageSpeed compatibility issue was captured in https://github.com/pagespeed/mod_pagespeed/issues/1263 and is mostly fixed (in trunk).

The bug includes rewriting for amp-img tags and that is not done, by default, but can be configured.


AFAICT quanglepro.com is not running mod_pagespeed, so I'm not sure whether Quangle's comment makes sense on this thread.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages