lazyload

[HTML5] Lazyload below the fold images and iframes with native browser lazy-loading

青春壹個敷衍的年華 提交于 2019-11-26 23:44:48
In this lesson, you'll learn how to use the loading="lazy" attribute available on images and iframes to lazily load below the fold images, which saves bandwidth and increases the load time performance of web pages. You'll also learn how to prevent images from lazy loading if necessary, and how to add lazy loading to responsive images as well. Lazy loading is supported in Chrome 76, and will be available in the next version of Edge and has public signals of support from Firefox, and Safari as well. <!DOCTYPE html> <style> img { border: 1px solid black; display: block; width: 400px; height:

web小技巧

狂风中的少年 提交于 2019-11-26 21:05:07
1、搜物网,css合并,js合并,分别一次性加载。还可以动静分离。 <link href=" http://www.sowu.com/style/merge.aspx?args=style/common.css,style/products.css,style/productsDec.css,style/asyncbox/asyncbox.css&_20150130_ " rel=" stylesheet" type=" text/css" /> <script src=" http://www.sowu.com/js/merge.aspx?args=js/jquery.js,js/focucmsg.js,js/prductPic.js,js/index/bannar_sowu.js,js/index/shopTabs.js,js/index/popup_tips.js,js/index/tabs.js,js/functions.js,/Js/lazyload/jquery.lazyload.js,js/tradecart.js,js/jquery.hoverIntent.minified.js,js/jquery.asyncbox.js,js/onetaobao.js,js/products/JSdetaiProdl.js,js/member/login.js&_20150130

Configure Jackson to omit lazy-loading attributes in Spring Boot

走远了吗. 提交于 2019-11-26 13:19:43
问题 In spring boot mvc project with pure java configuration how to configure Jackson to omit lazy load Attributes 回答1: With recent versions of Spring Boot this is much easier. Any beans of type com.fasterxml.jackson.databind.Module will be automatically registered with the auto-configured Jackson2ObjectMapperBuilder and applied to any ObjectMapper instances that it creates. This provides a global mechanism for contributing custom modules when you add new features to your application. 74.3

原生js实现图片懒加载+加入节流

拈花ヽ惹草 提交于 2019-11-26 12:45:56
这两天在学习图片的懒加载实现,看了很多大佬的博客,终于有了点成果。现在用了其中一位大佬的文章中的代码实现了图片懒加载并且在其基础上加入了节流函数。 原理就不多讲了,有需要的可以去大佬的文章看看。大佬文章可以从这里进->(https://www.jianshu.com/p/9b30b03f56c2)。 先上HTML结构: 1 <div></div> 2 <img src="" id="i1" data-src="image1"> 3 <div></div> 4 <img src="" id="i2" alt="" data-src="image2"> 然后是样式: 1 <style> 2 * { 3 padding: 0; 4 margin: 0; 5 } 6 7 div { 8 height: 2000px; 9 } 10 11 #i1 { 12 display: block; 13 width: 200px; 14 height: 200px; 15 background-color: red; 16 } 17 18 #i2 { 19 display: block; 20 width: 200px; 21 height: 200px; 22 background-color: green; 23 } 24 </style> 最后是JavaScript的代码: 1 <script>

页面优化(1)(草稿)

两盒软妹~` 提交于 2019-11-26 12:35:55
1. 优化方面: 网络 构建 服务端 浏览器渲染 2. 设计功能: 资源合并与压缩 关键点:减少http请求数 和 请求资源大小 cs 和 bs: cs架构gui软件的开发和部署 andriod:把代码打成apk包(发布一个apk包),用户下载并运行 bs架构(web前端) 代码发布到webserver/cdn 用户输入网址,浏览器发送http请求 具体方法: (1)dns信息进行缓存 (2)缓存dns减少dns查询时间 使用cdn解决静态资源、网络选择和缓存问题,但是去掉cookie(httpRequestHeader) 为什么携带上cookike: cdn域名和网站域名相同 所以,cdn域名不要和主站一样,防止访问cdn时携带主站cookie (3)接口 在浏览器上做缓存策略 (4)将多次http请求合并成一次,减少相同的网络消耗 (5)服务端做相应渲染 (6)相同的静态资源缓存 (7)走最近的网络环境 html压缩:压缩空格、制表符、换行符、html注释 手段: 在线网站、html-minifier、后端模板引擎渲染压缩 css压缩: 在线网站、html-minifier、clean-css js压缩: 在线网站、html-minifier、uglifyjs2 文件合并: 首屏渲染: 合并后的js大,加载慢 缓存失效: MD5戳,一个改动,整个文件都变 手段: 公共库合并