1

I am create AMP Pages in my web project, I need to display data from firebase in AMP pages. I use php and JavaScript to display data from firebase in web application.

KENdi
  • 7,576
  • 2
  • 16
  • 31
kishan patel
  • 125
  • 1
  • 5

1 Answers1

0

Amp pages are meant to be cache by google which means you need to server-render the pages as they will get crawled automatically by google bot.

SO, hit the firebase api from php / curl and render the data in php itself and produce AMP pages.

If you render template on client using java-script there are chances your amp may not get cached by google completely.

Atul Sharma
  • 9,397
  • 10
  • 38
  • 65
  • did you mean i have to create every AMP page programatically generate and save to my host directory ??? i have a lots of (business , products ) pages that i have to display in AMP page structure is same but content may different in every page. my other question is how to zomato works on AMP ??? it has many AMP pages with dynamic content how they are working ??? – kishan patel May 03 '17 at 06:50
  • see this question, https://stackoverflow.com/questions/43753477/how-to-display-dynamic-data-in-accelerated-mobile-pagesamp-from-firebase – kishan patel May 03 '17 at 07:15
  • AMP can only cache static pages , and iframes. Ajax calls are not supported i guess at the moment. Please link the zomato page you are talking about. – Atul Sharma May 03 '17 at 07:24
  • @atulquest93 zomato demo page.. please open this in mobile view https://www.google.co.in/amp/s/www.zomato.com/melbourne/roasting-warehouse-north-melbourne%3Famp%3D1 – Mitul Bhadeshiya May 03 '17 at 08:18
  • There no ajax call or any fire-base call ... the page is static html. Its serer rendered completely and html is cached by google. – Atul Sharma May 03 '17 at 11:03
  • If you navigate .. it will now load their mobile webapp and load data over ajax calls.. like https://www.zomato.com/melbourne/roasting-warehouse-north-melbourne/book .. but, the amp page is static server generated. – Atul Sharma May 03 '17 at 11:04