07 2021 档案
cookie、localstorage、seesionstorage的区别
摘要:cookie 4kb左右 每次都会携带在HTTP头中,如果使用cookie保存过多数据会带来性能问题 默认是关闭浏览器后失效, 但是也可以设置过期时间 localstorage 5M 仅在浏览器中保存,不参与和服务器的通信 除非手动被清除,否则永久保存 SessionStorage 5M 仅在浏览器
阅读全文
js节流和防抖函数
摘要:节流:将多次执行换成每隔一会短时间执行一次 function throttle(fn,time){ let lastTime = null; return function(){ let nowTime = Date.now(); if(nowTime - lastTime > time || !l
阅读全文
webpack 打包时内存溢出问题
摘要:方法一 步骤1、安装increase-memory-limit npm install -g increase-memory-limit 步骤2、项目跟目录中运行一下 increase-memory-limit 方法二 把devtool关闭,不添加sourcemap到内存 module.export
阅读全文
git push的时候报错 fatal: the remote end hung up unexpectedly
摘要:是因为推送的文件太大了,修改提交缓存大小为500M,或者更大的数字 方法一 配置.git 修改 .git 文件夹下的config文件,添加一段话,内容如下 [http]postBuffer = 524288000 方法二 命令 git config --global http.postBuffer
阅读全文