No, it's not only about size and js restrictions. Here is a summary of the strategies employed (edited from [0]).
- Execute all AMP JavaScript asynchronously
- Size all resources statically
- AMP uncouples document layout from resource layout. Only one HTTP request is needed to layout the entire doc.
- All CSS must be inline and size-bound
- Minimize style recalculations
- Only run GPU-accelerated animations
- Prioritize resource loading
- The new preconnect API is used heavily
- When AMP documents get prerendered for instant loading, only resources above the fold are actually downloaded. Resources that might use a lot of CPU (like third-party iframes) do not get downloaded.
OP's point was that those are all techniques that you don't need AMP to implement. So their question is: if those are the reason for you to use AMP, why use AMP and not just implement them directly?
The recommendations are to inline the important (render-blocking) CSS, so at most only the part of the CSS that applies to the 1K of HTML should be inlined.
Sorry, I was commenting generally. Don’t know about AMP. How does that make sense, though? What performance reasons could there possibly be for inlining CSS that doesn’t apply to any element in a page?
Likewise, I'm sorry, I didn't mean "you have to inline CSS that doesn't apply".
However, if you have non-render blocking CSS, or CSS that's used for below the fold or generally lower down the page content, "only render critical CSS inline" is usually coupled with "and then have the rest of your CSS in an external stylesheet". Which you are not allowed to do.
- Execute all AMP JavaScript asynchronously
- Size all resources statically
- AMP uncouples document layout from resource layout. Only one HTTP request is needed to layout the entire doc.
- All CSS must be inline and size-bound
- Minimize style recalculations
- Only run GPU-accelerated animations
- Prioritize resource loading
- The new preconnect API is used heavily
- When AMP documents get prerendered for instant loading, only resources above the fold are actually downloaded. Resources that might use a lot of CPU (like third-party iframes) do not get downloaded.
[0]: https://www.ampproject.org/learn/about-how/