Her - High-performence Enhanced Rendering Hao123前端高性能渲染解决方案
Her (High-performence Enhanced Rendering) is a Pagelet and Bigpipe like implement, to provide High-performence Rendering in web pages, which inspried by Fackbook's BigPipe: Pipelining web pages for high performance.
Her is made up of 3 parts, the build tool, the backend output controller and the frontend render controller. The build tool is based on FIS. The backend output controllers are FirstController
, QuicklingController
and NoScriptController
, in which FirstController
provide 4 render modes (server|lazy|default|none
). And the frontend render controller can load resources and render HTML snippet on demands.
The current implement is for PHP + Smarty. And this repo is the code of the build tool. The backend and frontend runtime code are here - her-runtime.
Hao123前端高性能渲染解决方案(Her)是一个为提升页面加载和渲染性能而设计的通用解决方案,实现了 Pagelet 和类 Bigpipe 输出渲染控制。
Her 由编译工具、后端输出控制和前端渲染控制组成,目前提供了基于 PHP 和 Smarty 的实现。其中编译工具基于 FIS 实现,继承了 FIS 强大的前端构建能力;后端输出控制提供了FirstController|QuicklingController|NoScriptController
3种输出控制器,分别处理基础页请求、局部 Quickling 请求和 NoScript 请求,其中 FirstController
提供 server|lazy|default|none
4种输出模式,方便实现首屏优化、模块开关等;前端渲染控制实现了资源加载、Pagelet 按需渲染和动态打包(planning)。通过对页面进行细粒度分块,收集区块的 HTML 片段、JS、CSS 等资源,后端输出控制和前端按需渲染,极大的增强了前端性能优化的能力。其设计方案和架构图如下:
本仓库为 Her 的构建工具代码,前后端运行时代码见 her-runtime
Her已经兼容fis-plus,请查看 FISP模块迁移文档
核心能力
Her 通过实现以下核心能力来解决前端性能优化:
适用场景
Her 适用于采用 Smarty 作为后端模板的 PC 和 Mobile 页面。
案例
参考
BigPipe: Pipelining web pages for high performance
FIS