当前位置:网站首页>6-13 improving load performance - application cache
6-13 improving load performance - application cache
2022-06-22 11:02:00 【bus_ lupe】
const cache = {
} // According to sub application name To do caching
export const parseHtml = async (entry, name) => {
if (cache[name]) {
return cache[name]
}
const html = await fetchResource(entry)
let allScript = []
const div = document.createElement('div')
div.innerHTML = html
const [dom, scriptUrl, script] = await getResources(div, entry)
const fetchedScripts = await Promise.all(scriptUrl.map(async item => fetchResource(item)))
allScript = script.concat(fetchedScripts)
cache[name] = [dom, allScript]
return [dom, allScript]
}
边栏推荐
- LeetCode Algorithm 剑指 Offer 18. 删除链表的节点
- 喜讯丨敏捷科技入选《2022年中国数字安全百强报告》
- 学会用VisualStudio开发人员工具查看对象模型
- What is the name of CITIC Securities app? Is it safe to open a stock account?
- nvm use之后重新打开终端还是显示修改之前的版本
- 在 Laravel 中使用计算列
- CVPR 2022 oral | a new motion oriented point cloud single target tracking paradigm
- In depth analysis of business model of blind box software development in 2022
- LeetCode Algorithm 21. Merge two ordered linked lists
- Go微服务(一)——RPC入门
猜你喜欢

Kirin software and Geer software focus on the development of network data security

Pytoch realizes wave impedance inversion

Spark streamlined interview

电装中国采用 Oracle HCM 云技术解决方案加速人力资源数字化转型

heidisql插入记录,总是出错,要怎么改?

交换类排序法

Pule frog VR typhoon escape experience VR disaster self rescue simulation system VR popular science knowledge equipment

Heidisql inserts records. There are always errors. How do you change them?

On the routing tree of gin

Byte 3: do you know what Eureka is?
随机推荐
今天,SysAK 是如何实现业务抖动监控及诊断?&手把手带你体验Anolis OS|第25-26期
这不会又是一个Go的BUG吧?
云端极简部署Svelte3聊天室
无线802.1x认证简介及配置方法
Pytoch realizes wave impedance inversion
Free and easy to use, Tencent arm cloud instance evaluation - AI reasoning acceleration
推荐一款M1芯片电脑快速搭建集群的虚拟机软件
What is the name of CITIC Securities app? Is it safe to open a stock account?
喜讯丨敏捷科技入选《2022年中国数字安全百强报告》
2022陕西省安全员B证操作证考试题库及在线模拟考试
Using computed columns in laravel
Web Configuration of Visual Studio Code
TCP 3次握手的通俗理解
MySQL使用SQL语句修改字段长度、字段名称
Pytorch实现波阻抗反演
MySQL使用SQL语句新增字段、删除字段
nodejs基础快速复习
MySQL每日面经【02】
[this tool, combined with JMeter, will increase your work efficiency by at least 80%, which is highly recommended]
PHP website, how to achieve the function of batch printing express orders?