Role of PHP file in PWA

孤者浪人 提交于 2021-01-29 11:52:14

问题


I am new to the PWA. So I was trying to create a basic website. which include index.html, manifest, serviceworker file, answer.php. Answer.php is running on server. on clicking a button in index.html, it goes to answer.php where data is obtained from the database. I am caching all the files except serviceworker and answer.php.

Q1: Should I cache answer.php?

Q2: If not, then how can I connect it to indexed db (represent data obtained from server in the form of html file).

Q3: what is the role of server files in PWA.


回答1:


Q1: Should i cache answer.php?

I don't think so, since its generating data querying the database.

Q2: If not, then how can i connect it to indexed db (represent data obtained from server in the form of html file).

You can use answer.php to return a JSON to your PWA: Manual JSON Encode

Q3: what is the role of server files in PWA

Any backend services. I.E.: How to build a JSON backend with PHP



来源:https://stackoverflow.com/questions/58016408/role-of-php-file-in-pwa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!