使用Laravel构建类别的正确方法是什么

发布于 2025-01-31 05:13:35 字数 231 浏览 2 评论 0原文

我们有一个数字平台,其功能是使用户能够自己创建一个在线商店,

我们面临着类别的问题。它们是内置的,但是他们花了很长时间才能在浏览器上加载

什么是易于构建它的正确方法,适用于服务器和浏览器

屏幕快照以显示所花费的时间

We have a digital platform whose function is to enable the user to create an online store on his own

We are facing a problem with the categories. They are built in, but they take a very long time to load on the browser

What is the correct way to build it lightly and suitable for server and browser

Screenshot to show the time taken

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮光之海 2025-02-07 05:13:35

如果它是由JS库渲染的,则可以使用浏览器LocalStorage可以帮助您更快地加载它。
但是,如果您自己渲染它,那是一个很好的做法,可以按照下图中所示的方式存储类别。

并使用缓存机制将菜单结构存储在内存中,并将其检索到前端如此之快。

If it is rendering by js libraries, maybe using browser localStorage helps you load it faster.
But if you are rendering it by yourself, It is a good practice to store categories as depicted in the image below.
enter image description here

and use caching mechanism to store the menu structure in memory and retrieve it in the front-end so fast.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文