Web性能优化:图片优化 有更新!

  |   0 评论   |   0 浏览

HTTP Archieve有个统计,图片内容已经占到了互联网内容总量的 62% ,也就是说超过一半的流量和时间都用来下载图片。从性能优化的角度看,图片也绝对是优化的热点和重点之一,Google PageSpeed 或者 Yahoo 的 14 条性能优化规则无不把图片优化作为重要的优化手段,本文覆盖了 Web 图片优化的方方面面,从基本的图片格式选择、到尚未被广泛支持的响应式图片均有所提及。

Google Web Fundamentals 的说法我很喜欢:

图片优化既是一门艺术,也是一门科学,图片优化是一门艺术,是因为单个图片的压缩不存在最好的特定性方案,而图片优化之所以是一门科学,是因为许多开发得很出色的方法和算法可以明显减小图片的大小。要找到图片的最优设置,需要按照许多维度进行认真分析:格式能力、编码数据内容、像素尺寸等。

Javascript Injection With Selenium, Puppeteer, And Marionette In Chrome And Firefox 有更新!

  |   0 评论   |   0 浏览

Browser automation frameworks–like Puppeteer, Selenium, Marionette, and Nightmare.js–strive to provide rich APIs for configuring and interacting with Web browsers. These generally work quite well, but you’re inevitably going to end up running into API limitations if you do a lot of testing or Web scraping. You might find yourself wanting to conceal the fact that you’re using a headless browser, extract image resources from a Web page, set the seed for Math.random(), or mock the browser’s geolocation before running your test suite. Your specific automation framework might provide a built-in way to accomplish some of these, but they all have their limitations.

App爬虫神器Mitmproxy和Mitmdump的使用 有更新!

  |   0 评论   |   0 浏览

mitmproxy 是一个支持 HTTP 和 HTTPS 的抓包程序,有类似 Fiddler、Charles 的功能,只不过它是一个控制台的形式操作。

timg1jpg

mitmproxy 还有两个关联组件。一个是 mitmdump,它是 mitmproxy 的命令行接口,利用它我们可以对接 Python 脚本,用 Python 实现监听后的处理。另一个是 mitmweb,它是一个 Web 程序,通过它我们可以清楚观察 mitmproxy 捕获的请求。