Critical css, above the fold content and rendered views

烂漫一生 提交于 2019-12-24 11:33:52

问题


I'm currently working on my gulp building/deploying pipeline. All the content available on the web about the critical-css-inlining is nice and pretty but it doesn't fit well with real world scenarios where your pages (views) are dinamically assembled. I have:

  • header.html
  • view.html (home.html, about.html, single.html, category.html)
  • footer.html

Any web page is a concatenated header + view + footer. Content is not predictable: you cannot know how many articles there will be in a rendered category view.

Should I build fake assembled views with the maximum amount of content that can be displayed in the above the fold portion for each views and extract then the css? Is there any already known method to accomplish the goal?

It's not about wordpress so please don't mention plugins or stuff like that.


回答1:


use this: https://www.npmjs.com/package/grunt-critical-css

on the yeoman-blog are also a lot of grunt/gulp recommendations if you want to increase your page performance in general: http://yeoman.io/blog/performance-optimization.html



来源:https://stackoverflow.com/questions/30964257/critical-css-above-the-fold-content-and-rendered-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!