3. Numbers
1 Million - Distinct AMP articles rendered per day.
440k - The size of the average canonical page CSS.
31k - The size of the average AMP page CSS
600ms - Time to convert, from cold, a typical page.
100ms - CPU Time to convert a Page
1 Second - Median DOM Content Loaded.
3
11. Check Each Part
.foo .bar a.baz { … }
If any one part isn’t in the dom delete the selector.
If you’ve deleted all the selectors delete the CSS block.
10 X Faster than $(“.foo .bar a.baz”)
11
12. Still Too Big? Rename All The Things
.header-very-long-class-name -> .cd
#veryDescriptiveIdThatIsUsedOnce -> #de
Watch out for
[class^=“very-long-class-“] and amp-*
12
16. Enough of CSS - HTML Edge Cases
<iframes are us>
If it’s an <iframe> and it can be https make it an <amp-iframe>
Lots of things can be HTTPS they just don’t admit it.
Examples:
Storify, SurveyGizmo, ispot.tv, ABC TV embeds,
C-Span, Kickstarter, gfycat, giphy, livestream
16
17. Shims all the way down.
Resizable JS element with a shim: Disqus Comments.
AMP Page -> <amp-iframe> (shim) -> <regular iframe>
Shim listens for resize events from regular iframe,
passes to AMP
Remember to add placeholder and overflow elements.
Sample:
https://storage.googleapis.com/relay-media-assets/
players/disqus-shim.html
17
20. For a Fist Full of Dollars
Put Ads in the Content
300x250 after paragraph 2
300x250’s every N paragraphs.
20
21. For a Few Dollars More
You need more that DFP -> ADX
Nativo, Teads
Private exchanges
Make sure your video pre-roll works.
Include Direct Sold
21
22. Use amp-experiment to Test Ads and UX
data-loading-strategy=“prefer-viewability-over-views”
amp-sticky-ad vs 320x50 top banner
What elements are “road blocks” that cause people
to stop reading?
22