PHP文件在PWA中的作用 [英] Role of PHP file in PWA

查看:59
本文介绍了PHP文件在PWA中的作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 PWA 的新手.所以我试图创建一个基本的网站.其中包括索引.html,显现,服务工作者文件,回答.php.Answer.php 正在服务器上运行.单击 index.html 中的按钮时,它会转到 answer.php,其中从数据库中获取数据.我正在缓存除 serviceworker 和 answer.php 之外的所有文件.

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:我应该缓存 answer.php 吗?

Q1: Should I cache answer.php?

Q2:如果没有,那么我如何将其连接到索引数据库(以html文件的形式表示从服务器获取的数据).

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

Q3:服务器文件在 PWA 中的作用是什么.

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

推荐答案

Q1: 我应该缓存 answer.php 吗?

我不这么认为,因为它生成查询数据库的数据.

Q2:如果没有,那么我如何将其连接到索引数据库(以 html 文件的形式表示从服务器获取的数据).

您可以使用 answer.php 将 JSON 返回到您的 PWA: 手动 JSON 编码

Q3:服务器文件在 PWA 中的作用是什么

任何后端服务. IE:如何构建 JSON 后端PHP

这篇关于PHP文件在PWA中的作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆