dongyongmin5711 2019-05-11 20:10 采纳率: 100%
浏览 148

将Laravel转换为PWA

I want to convert my laravel application (e-commerce store) into a progressive web application (pwa). How do I do that? Does it need a complete SPA in vue or it can be done using blade template engine (blade view files)? What is the proper way to do it ?

  • 写回答

1条回答 默认 最新

  • douji1853 2019-05-11 20:37
    关注

    It really depends on what's the current state of your application, however you can start one step at the time with making your web a PWA.

    Couple of things you need are:

    1. SSL certificate, because the service worker

    Using service worker you can hijack connections, fabricate, and filter responses. Powerful stuff. While you would use these powers for good, a man-in-the-middle might not. To avoid this, you can only register service workers on pages served over HTTPS, so we know the service worker the browser receives hasn't been tampered with during its journey through the network.

    Don't required on your local while you are developing stuff.

    1. A service worker you can read more about this on the link.

    For the service worker there a few options out there to help you getting started with different caching strategies for sections of your page.

    A great example of this is: https://developers.google.com/web/tools/workbox/

    You have a full list detailed here with the full list of things you need to cover.

    Another thing is with PWA it does not have to be all your site to work online working iteratively it's great as you can start with a simple page to show a message when you don't have connection to the internet and after that start adding more features.

    As mentioned above Google has a great list of resources for this at:

    In the context of Laravel as long as your views are rendered (blade) you can cache the responses or specific content with the service worker.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大