Accelerated Mobile Page - Dynamic Pages

I am very impressed with the new AMP and would like to implement it on my mobile site. Most of the content on my mobile site is a dynamic value based on the login user that will retrieve data from different backend services, such as mysql and sphinx, and will display the results.

Can I use AMP for my mobile site. After doing a search on Google, I found that people recommend it for static pages. Just like the CDN caching method works for dynamic pages in AMP.

+4
source share
3 answers

You can use the component amp-listto embed the dynamic content of a specific user ( docs , example ). The name is a amp-listlittle misleading, as you can use it for individual elements. This will also work if your AMP is loaded via cache.

Another possibility is to use iframes .

+2
source

I was also interested to know how the cache for dynamic pages works. I found a problem in AMP Github that basically explains that the Google cache respects the max-age Cache-control attributes in the http header to evaluate when the cache has to be updated. The only thing that doesn't work is to set it to 0.

, .

AMP GitHub: https://github.com/ampproject/amphtml/issues/1901

0

AMP . AMP - WordPress, AMP, -.

: https://www.ampproject.org

, , AMP .

-, AMP AMP :

  • , , AMP , :

    <link rel="amphtml" href="exact-url-to-you-amp-version-of-this-page" />

  • AMP , rel= canonical, , AMP :

    <link rel="canonical" href="exact-url-to-your-original-non-amp-page" />

. AMP , script img. https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#html-tags

, , , , AMP HTML , AMP. , . I.e img- amp-img, iframe, html-. .. , CSS CSS .. https://www.ampproject.org/docs/get_started/create/basic_markup.html

AMP, , # development = 1 URL- Chrome Console. : https://www.ampproject.org/docs/guides/validate.html

-2
source

Source: https://habr.com/ru/post/1622242/


All Articles